From d3414d6ce777e996a6ac5ced7e02403118f151e8 Mon Sep 17 00:00:00 2001 From: Percy Wegmann Date: Thu, 22 Aug 2024 15:03:34 -0500 Subject: [PATCH] change import paths to github.com/tailscale/netlink This removes any dependency on github.com/vishvananda/netlink, which has evolved well beyond our fork and is no longer API compatible with it. Updates tailscale/tailscale#12298 Signed-off-by: Percy Wegmann --- .travis.yml | 2 +- Makefile | 2 +- README.md | 10 +++++----- addr_linux.go | 2 +- bridge_linux.go | 2 +- class_linux.go | 2 +- cmd/ipset-test/main.go | 3 ++- conntrack_linux.go | 2 +- conntrack_test.go | 3 ++- devlink_linux.go | 2 +- filter_linux.go | 5 +++-- fou_linux.go | 3 ++- genetlink_linux.go | 2 +- gtp_linux.go | 2 +- handle_linux.go | 2 +- handle_test.go | 3 ++- ipset_linux.go | 2 +- ipset_linux_test.go | 2 +- link_linux.go | 2 +- link_test.go | 3 ++- neigh_linux.go | 2 +- netlink_linux.go | 2 +- netns_linux.go | 2 +- order.go | 2 +- protinfo_linux.go | 2 +- qdisc_linux.go | 2 +- rdma_link_linux.go | 3 ++- route_linux.go | 2 +- route_test.go | 3 ++- rule_linux.go | 2 +- socket_linux.go | 2 +- xfrm_monitor_linux.go | 2 +- xfrm_monitor_test.go | 3 ++- xfrm_policy_linux.go | 2 +- xfrm_state_linux.go | 2 +- 35 files changed, 49 insertions(+), 40 deletions(-) diff --git a/.travis.yml b/.travis.yml index 80219c69..9565b496 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,4 +17,4 @@ before_script: - sudo modprobe sch_sfq install: - go get -v -t ./... -go_import_path: github.com/vishvananda/netlink +go_import_path: github.com/tailscale/netlink diff --git a/Makefile b/Makefile index a0e68e7a..1b210be8 100644 --- a/Makefile +++ b/Makefile @@ -19,7 +19,7 @@ $(call goroot,$(DEPS)): .PHONY: $(call testdirs,$(DIRS)) $(call testdirs,$(DIRS)): - go test -test.exec sudo -test.parallel 4 -timeout 60s -test.v github.com/vishvananda/netlink/$@ + go test -test.exec sudo -test.parallel 4 -timeout 60s -test.v github.com/tailscale/netlink/$@ $(call fmt,$(call testdirs,$(DIRS))): ! gofmt -l $(subst fmt-,,$@)/*.go | grep -q . diff --git a/README.md b/README.md index 0e4ddb01..101084bf 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # netlink - netlink library for go # -[![Build Status](https://app.travis-ci.com/vishvananda/netlink.svg?branch=master)](https://app.travis-ci.com/github/vishvananda/netlink) [![GoDoc](https://godoc.org/github.com/vishvananda/netlink?status.svg)](https://godoc.org/github.com/vishvananda/netlink) +[![Build Status](https://app.travis-ci.com/vishvananda/netlink.svg?branch=master)](https://app.travis-ci.com/github/vishvananda/netlink) [![GoDoc](https://godoc.org/github.com/tailscale/netlink?status.svg)](https://godoc.org/github.com/tailscale/netlink) The netlink package provides a simple netlink library for go. Netlink is the interface a user-space program in linux uses to communicate with @@ -20,7 +20,7 @@ functionality like ipsec xfrm handling. You can use go get command: - go get github.com/vishvananda/netlink + go get github.com/tailscale/netlink Testing dependencies: @@ -28,7 +28,7 @@ Testing dependencies: Testing (requires root): - sudo -E go test github.com/vishvananda/netlink + sudo -E go test github.com/tailscale/netlink ## Examples ## @@ -39,7 +39,7 @@ package main import ( "fmt" - "github.com/vishvananda/netlink" + "github.com/tailscale/netlink" ) func main() { @@ -66,7 +66,7 @@ Add a new ip address to loopback: package main import ( - "github.com/vishvananda/netlink" + "github.com/tailscale/netlink" ) func main() { diff --git a/addr_linux.go b/addr_linux.go index e4a167dd..118d054f 100644 --- a/addr_linux.go +++ b/addr_linux.go @@ -6,7 +6,7 @@ import ( "strings" "syscall" - "github.com/vishvananda/netlink/nl" + "github.com/tailscale/netlink/nl" "github.com/vishvananda/netns" "golang.org/x/sys/unix" ) diff --git a/bridge_linux.go b/bridge_linux.go index 6e1224c4..d03f856d 100644 --- a/bridge_linux.go +++ b/bridge_linux.go @@ -3,7 +3,7 @@ package netlink import ( "fmt" - "github.com/vishvananda/netlink/nl" + "github.com/tailscale/netlink/nl" "golang.org/x/sys/unix" ) diff --git a/class_linux.go b/class_linux.go index 6f542ba4..a576a749 100644 --- a/class_linux.go +++ b/class_linux.go @@ -8,7 +8,7 @@ import ( "fmt" "syscall" - "github.com/vishvananda/netlink/nl" + "github.com/tailscale/netlink/nl" "golang.org/x/sys/unix" ) diff --git a/cmd/ipset-test/main.go b/cmd/ipset-test/main.go index 84c2a278..affa53ec 100644 --- a/cmd/ipset-test/main.go +++ b/cmd/ipset-test/main.go @@ -1,3 +1,4 @@ +//go:build linux // +build linux package main @@ -10,7 +11,7 @@ import ( "os" "sort" - "github.com/vishvananda/netlink" + "github.com/tailscale/netlink" ) type command struct { diff --git a/conntrack_linux.go b/conntrack_linux.go index 03ea1b98..b5b211ed 100644 --- a/conntrack_linux.go +++ b/conntrack_linux.go @@ -8,7 +8,7 @@ import ( "net" "time" - "github.com/vishvananda/netlink/nl" + "github.com/tailscale/netlink/nl" "golang.org/x/sys/unix" ) diff --git a/conntrack_test.go b/conntrack_test.go index 08e35f13..43cf6d40 100644 --- a/conntrack_test.go +++ b/conntrack_test.go @@ -1,3 +1,4 @@ +//go:build linux // +build linux package netlink @@ -11,7 +12,7 @@ import ( "testing" "time" - "github.com/vishvananda/netlink/nl" + "github.com/tailscale/netlink/nl" "github.com/vishvananda/netns" "golang.org/x/sys/unix" ) diff --git a/devlink_linux.go b/devlink_linux.go index 358b232c..d65c32dd 100644 --- a/devlink_linux.go +++ b/devlink_linux.go @@ -6,7 +6,7 @@ import ( "strings" "syscall" - "github.com/vishvananda/netlink/nl" + "github.com/tailscale/netlink/nl" "golang.org/x/sys/unix" ) diff --git a/filter_linux.go b/filter_linux.go index d5d45c87..bb3384ee 100644 --- a/filter_linux.go +++ b/filter_linux.go @@ -9,7 +9,7 @@ import ( "net" "syscall" - "github.com/vishvananda/netlink/nl" + "github.com/tailscale/netlink/nl" "golang.org/x/sys/unix" ) @@ -53,7 +53,8 @@ func (filter *U32) Type() string { // Fw filter filters on firewall marks // NOTE: this is in filter_linux because it refers to nl.TcPolice which -// is defined in nl/tc_linux.go +// +// is defined in nl/tc_linux.go type Fw struct { FilterAttrs ClassId uint32 diff --git a/fou_linux.go b/fou_linux.go index ed55b2b7..b2b98ffc 100644 --- a/fou_linux.go +++ b/fou_linux.go @@ -1,3 +1,4 @@ +//go:build linux // +build linux package netlink @@ -6,7 +7,7 @@ import ( "encoding/binary" "errors" - "github.com/vishvananda/netlink/nl" + "github.com/tailscale/netlink/nl" "golang.org/x/sys/unix" ) diff --git a/genetlink_linux.go b/genetlink_linux.go index 772e5834..95d1e7af 100644 --- a/genetlink_linux.go +++ b/genetlink_linux.go @@ -4,7 +4,7 @@ import ( "fmt" "syscall" - "github.com/vishvananda/netlink/nl" + "github.com/tailscale/netlink/nl" "golang.org/x/sys/unix" ) diff --git a/gtp_linux.go b/gtp_linux.go index f5e160ba..c0f701bb 100644 --- a/gtp_linux.go +++ b/gtp_linux.go @@ -6,7 +6,7 @@ import ( "strings" "syscall" - "github.com/vishvananda/netlink/nl" + "github.com/tailscale/netlink/nl" "golang.org/x/sys/unix" ) diff --git a/handle_linux.go b/handle_linux.go index c02bfb7e..93a6795b 100644 --- a/handle_linux.go +++ b/handle_linux.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/vishvananda/netlink/nl" + "github.com/tailscale/netlink/nl" "github.com/vishvananda/netns" "golang.org/x/sys/unix" ) diff --git a/handle_test.go b/handle_test.go index ac627ba9..8e5c302e 100644 --- a/handle_test.go +++ b/handle_test.go @@ -1,3 +1,4 @@ +//go:build linux // +build linux package netlink @@ -14,7 +15,7 @@ import ( "time" "unsafe" - "github.com/vishvananda/netlink/nl" + "github.com/tailscale/netlink/nl" "github.com/vishvananda/netns" "golang.org/x/sys/unix" ) diff --git a/ipset_linux.go b/ipset_linux.go index 1f4eae81..22f85d43 100644 --- a/ipset_linux.go +++ b/ipset_linux.go @@ -6,7 +6,7 @@ import ( "net" "syscall" - "github.com/vishvananda/netlink/nl" + "github.com/tailscale/netlink/nl" "golang.org/x/sys/unix" ) diff --git a/ipset_linux_test.go b/ipset_linux_test.go index 867f4d57..88a8441e 100644 --- a/ipset_linux_test.go +++ b/ipset_linux_test.go @@ -6,7 +6,7 @@ import ( "net" "testing" - "github.com/vishvananda/netlink/nl" + "github.com/tailscale/netlink/nl" "golang.org/x/sys/unix" ) diff --git a/link_linux.go b/link_linux.go index ad8447b2..0e03bfaf 100644 --- a/link_linux.go +++ b/link_linux.go @@ -12,7 +12,7 @@ import ( "syscall" "unsafe" - "github.com/vishvananda/netlink/nl" + "github.com/tailscale/netlink/nl" "github.com/vishvananda/netns" "golang.org/x/sys/unix" ) diff --git a/link_test.go b/link_test.go index 1ecf21e1..e7be1c66 100644 --- a/link_test.go +++ b/link_test.go @@ -1,3 +1,4 @@ +//go:build linux // +build linux package netlink @@ -12,7 +13,7 @@ import ( "testing" "time" - "github.com/vishvananda/netlink/nl" + "github.com/tailscale/netlink/nl" "github.com/vishvananda/netns" "golang.org/x/sys/unix" ) diff --git a/neigh_linux.go b/neigh_linux.go index 4c1e7663..23b4b7e8 100644 --- a/neigh_linux.go +++ b/neigh_linux.go @@ -6,7 +6,7 @@ import ( "syscall" "unsafe" - "github.com/vishvananda/netlink/nl" + "github.com/tailscale/netlink/nl" "github.com/vishvananda/netns" "golang.org/x/sys/unix" ) diff --git a/netlink_linux.go b/netlink_linux.go index a20d293d..69d712c4 100644 --- a/netlink_linux.go +++ b/netlink_linux.go @@ -1,6 +1,6 @@ package netlink -import "github.com/vishvananda/netlink/nl" +import "github.com/tailscale/netlink/nl" // Family type definitions const ( diff --git a/netns_linux.go b/netns_linux.go index 2eb29c7c..c2573cac 100644 --- a/netns_linux.go +++ b/netns_linux.go @@ -15,7 +15,7 @@ package netlink import ( "fmt" - "github.com/vishvananda/netlink/nl" + "github.com/tailscale/netlink/nl" "golang.org/x/sys/unix" ) diff --git a/order.go b/order.go index e28e153a..c3248ea5 100644 --- a/order.go +++ b/order.go @@ -3,7 +3,7 @@ package netlink import ( "encoding/binary" - "github.com/vishvananda/netlink/nl" + "github.com/tailscale/netlink/nl" ) var ( diff --git a/protinfo_linux.go b/protinfo_linux.go index 15b65123..d5fe605e 100644 --- a/protinfo_linux.go +++ b/protinfo_linux.go @@ -4,7 +4,7 @@ import ( "fmt" "syscall" - "github.com/vishvananda/netlink/nl" + "github.com/tailscale/netlink/nl" "golang.org/x/sys/unix" ) diff --git a/qdisc_linux.go b/qdisc_linux.go index 9fc4b3d2..7898b56a 100644 --- a/qdisc_linux.go +++ b/qdisc_linux.go @@ -7,7 +7,7 @@ import ( "strings" "syscall" - "github.com/vishvananda/netlink/nl" + "github.com/tailscale/netlink/nl" "golang.org/x/sys/unix" ) diff --git a/rdma_link_linux.go b/rdma_link_linux.go index 036399db..6a09332c 100644 --- a/rdma_link_linux.go +++ b/rdma_link_linux.go @@ -6,7 +6,7 @@ import ( "fmt" "net" - "github.com/vishvananda/netlink/nl" + "github.com/tailscale/netlink/nl" "golang.org/x/sys/unix" ) @@ -307,6 +307,7 @@ func (h *Handle) RdmaLinkDel(name string) error { // RdmaLinkAdd adds an rdma link for the specified type to the network device. // Similar to: rdma link add NAME type TYPE netdev NETDEV +// // NAME - specifies the new name of the rdma link to add // TYPE - specifies which rdma type to use. Link types: // rxe - Soft RoCE driver diff --git a/route_linux.go b/route_linux.go index b059d4a9..0bccafe4 100644 --- a/route_linux.go +++ b/route_linux.go @@ -9,7 +9,7 @@ import ( "strings" "syscall" - "github.com/vishvananda/netlink/nl" + "github.com/tailscale/netlink/nl" "github.com/vishvananda/netns" "golang.org/x/sys/unix" ) diff --git a/route_test.go b/route_test.go index 46eef976..6a08fe46 100644 --- a/route_test.go +++ b/route_test.go @@ -1,3 +1,4 @@ +//go:build linux // +build linux package netlink @@ -8,7 +9,7 @@ import ( "testing" "time" - "github.com/vishvananda/netlink/nl" + "github.com/tailscale/netlink/nl" "github.com/vishvananda/netns" "golang.org/x/sys/unix" ) diff --git a/rule_linux.go b/rule_linux.go index 7b9e5b2d..aefffaeb 100644 --- a/rule_linux.go +++ b/rule_linux.go @@ -5,7 +5,7 @@ import ( "fmt" "net" - "github.com/vishvananda/netlink/nl" + "github.com/tailscale/netlink/nl" "golang.org/x/sys/unix" ) diff --git a/socket_linux.go b/socket_linux.go index b881fe49..58cb3aa8 100644 --- a/socket_linux.go +++ b/socket_linux.go @@ -6,7 +6,7 @@ import ( "net" "syscall" - "github.com/vishvananda/netlink/nl" + "github.com/tailscale/netlink/nl" "golang.org/x/sys/unix" ) diff --git a/xfrm_monitor_linux.go b/xfrm_monitor_linux.go index 985d3a91..8fa5dc8e 100644 --- a/xfrm_monitor_linux.go +++ b/xfrm_monitor_linux.go @@ -3,7 +3,7 @@ package netlink import ( "fmt" - "github.com/vishvananda/netlink/nl" + "github.com/tailscale/netlink/nl" "github.com/vishvananda/netns" "golang.org/x/sys/unix" ) diff --git a/xfrm_monitor_test.go b/xfrm_monitor_test.go index 1bd70910..ebca418b 100644 --- a/xfrm_monitor_test.go +++ b/xfrm_monitor_test.go @@ -1,3 +1,4 @@ +//go:build linux // +build linux package netlink @@ -5,7 +6,7 @@ package netlink import ( "testing" - "github.com/vishvananda/netlink/nl" + "github.com/tailscale/netlink/nl" ) func TestXfrmMonitorExpire(t *testing.T) { diff --git a/xfrm_policy_linux.go b/xfrm_policy_linux.go index 694bd74e..48fc1b9a 100644 --- a/xfrm_policy_linux.go +++ b/xfrm_policy_linux.go @@ -1,7 +1,7 @@ package netlink import ( - "github.com/vishvananda/netlink/nl" + "github.com/tailscale/netlink/nl" "golang.org/x/sys/unix" ) diff --git a/xfrm_state_linux.go b/xfrm_state_linux.go index 3b37b87d..f82e0908 100644 --- a/xfrm_state_linux.go +++ b/xfrm_state_linux.go @@ -4,7 +4,7 @@ import ( "fmt" "unsafe" - "github.com/vishvananda/netlink/nl" + "github.com/tailscale/netlink/nl" "golang.org/x/sys/unix" )