1
0
mirror of https://github.com/rancher/os.git synced 2025-09-05 00:37:12 +00:00

Vendor changes for vishvananda/netlink

https://github.com/rancher/os/issues/1863
This commit is contained in:
niusmallnan
2017-12-19 09:13:13 +00:00
committed by niusmallnan
parent bd845cca31
commit 958bbef1f1
25 changed files with 1935 additions and 57 deletions

View File

@@ -38,15 +38,18 @@ Add a new bridge and add eth1 into it:
package main
import (
"net"
"fmt"
"github.com/vishvananda/netlink"
)
func main() {
la := netlink.NewLinkAttrs()
la.Name = "foo"
mybridge := &netlink.Bridge{la}}
_ := netlink.LinkAdd(mybridge)
mybridge := &netlink.Bridge{LinkAttrs: la}
err := netlink.LinkAdd(mybridge)
if err != nil {
fmt.Printf("could not add %s: %v\n", la.Name, err)
}
eth1, _ := netlink.LinkByName("eth1")
netlink.LinkSetMaster(eth1, mybridge)
}
@@ -63,7 +66,6 @@ Add a new ip address to loopback:
package main
import (
"net"
"github.com/vishvananda/netlink"
)