Upgrade to use latest netlink and add old interface name to alt names
This commit is contained in:
parent
1220119aed
commit
d83ba0bff0
6
go.mod
6
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
|
||||
)
|
||||
|
|
3
main.go
3
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)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue