mirror of https://github.com/vishvananda/netlink
Add netnsid to link attrs
This commit is contained in:
parent
808afc82b2
commit
b2de5d10e3
1
link.go
1
link.go
|
@ -37,6 +37,7 @@ type LinkAttrs struct {
|
|||
EncapType string
|
||||
Protinfo *Protinfo
|
||||
OperState LinkOperState
|
||||
NetNsID int
|
||||
}
|
||||
|
||||
// LinkOperState represents the values of the IFLA_OPERSTATE link
|
||||
|
|
|
@ -1268,6 +1268,8 @@ func LinkDeserialize(hdr *syscall.NlMsghdr, m []byte) (Link, error) {
|
|||
}
|
||||
case syscall.IFLA_OPERSTATE:
|
||||
base.OperState = LinkOperState(uint8(attr.Value[0]))
|
||||
case nl.IFLA_LINK_NETNSID:
|
||||
base.NetNsID = int(native.Uint32(attr.Value[0:4]))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue