diff --git a/example_link_setdown_test.go b/example_link_setdown_test.go index dfdd13b..e5bc0b6 100644 --- a/example_link_setdown_test.go +++ b/example_link_setdown_test.go @@ -33,7 +33,7 @@ func Example_setLinkDown() { // Set the interface operationally Down err = conn.Link.Set(&rtnetlink.LinkMessage{ - Family: msg.Family, + Family: 0x0, Type: msg.Type, Index: uint32(iface.Index), Flags: 0x0, diff --git a/example_link_sethwaddr_test.go b/example_link_sethwaddr_test.go index 28c7238..acc25b9 100644 --- a/example_link_sethwaddr_test.go +++ b/example_link_sethwaddr_test.go @@ -29,7 +29,7 @@ func Example_setLinkHWAddr() { // Set the hw address of the interfaces err = conn.Link.Set(&rtnetlink.LinkMessage{ - Family: msg.Family, + Family: 0x0, Type: msg.Type, Index: uint32(iface.Index), Flags: msg.Flags, diff --git a/example_link_setup_test.go b/example_link_setup_test.go index 2cb8242..acb99cc 100644 --- a/example_link_setup_test.go +++ b/example_link_setup_test.go @@ -37,7 +37,7 @@ func Example_setLinkUp() { // Set the interface operationally UP err = conn.Link.Set(&rtnetlink.LinkMessage{ - Family: msg.Family, + Family: unix.AF_UNSPEC, Type: msg.Type, Index: uint32(iface.Index), Flags: unix.IFF_UP, diff --git a/rtnl/link.go b/rtnl/link.go index 22654b4..1b96feb 100644 --- a/rtnl/link.go +++ b/rtnl/link.go @@ -92,7 +92,7 @@ func (c *Conn) LinkUp(ifc *net.Interface) error { return err } tx := &rtnetlink.LinkMessage{ - Family: rx.Family, + Family: unix.AF_UNSPEC, Type: rx.Type, Index: uint32(ifc.Index), Flags: unix.IFF_UP, @@ -108,7 +108,7 @@ func (c *Conn) LinkDown(ifc *net.Interface) error { return err } tx := &rtnetlink.LinkMessage{ - Family: rx.Family, + Family: unix.AF_UNSPEC, Type: rx.Type, Index: uint32(ifc.Index), Flags: 0,