Add netnsid to link attrs

This commit is contained in:
Sylvain Afchain 2017-10-14 00:39:06 +02:00 committed by Vish (Ishaya) Abrams
parent 808afc82b2
commit b2de5d10e3
2 changed files with 3 additions and 0 deletions

View File

@ -37,6 +37,7 @@ type LinkAttrs struct {
EncapType string
Protinfo *Protinfo
OperState LinkOperState
NetNsID int
}
// LinkOperState represents the values of the IFLA_OPERSTATE link

View File

@ -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]))
}
}