From d83ba0bff0bf8875dc87a56b198739b6f4fa2bda Mon Sep 17 00:00:00 2001 From: Alex Denes Date: Tue, 25 Jun 2024 10:27:25 +0000 Subject: [PATCH] Upgrade to use latest netlink and add old interface name to alt names --- go.mod | 6 +++--- main.go | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index b7be6ea..bfce95f 100644 --- a/go.mod +++ b/go.mod @@ -2,9 +2,9 @@ module git.redxen.eu/caskd/net-predictable go 1.22.3 -require github.com/vishvananda/netlink v1.1.0 +require github.com/vishvananda/netlink v1.2.1-beta.2.0.20240524165444-4d4ba1473f21 require ( - github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df // indirect - golang.org/x/sys v0.0.0-20190606203320-7fc4e5ec1444 // indirect + github.com/vishvananda/netns v0.0.0-20200728191858-db3c7e526aae // indirect + golang.org/x/sys v0.10.0 // indirect ) diff --git a/main.go b/main.go index e0abbc0..9f45883 100644 --- a/main.go +++ b/main.go @@ -73,4 +73,7 @@ func main() { if err = netlink.LinkSetName(l, nln); err != nil { mainlog.Fatalf("Could not rename interface %s: %s\n", ifname, err) } + if err = netlink.LinkAddAltName(l, ifname); err != nil { + mainlog.Printf("Adding original name as interface alias failed for %s: %s\n", ifname, err) + } }