Add PHYS_SWITCH_ID attribute to LinkAttrs

This commit is contained in:
Dennis Afanasev 2021-06-08 18:58:27 +00:00 committed by Alessandro Boch
parent d1fad16de5
commit 21f2c55a77
2 changed files with 3 additions and 0 deletions

View File

@ -41,6 +41,7 @@ type LinkAttrs struct {
EncapType string
Protinfo *Protinfo
OperState LinkOperState
PhysSwitchID int
NetNsID int
NumTxQueues int
NumRxQueues int

View File

@ -1903,6 +1903,8 @@ func LinkDeserialize(hdr *unix.NlMsghdr, m []byte) (Link, error) {
}
case unix.IFLA_OPERSTATE:
base.OperState = LinkOperState(uint8(attr.Value[0]))
case unix.IFLA_PHYS_SWITCH_ID:
base.PhysSwitchID = int(native.Uint32(attr.Value[0:4]))
case unix.IFLA_LINK_NETNSID:
base.NetNsID = int(native.Uint32(attr.Value[0:4]))
case unix.IFLA_GSO_MAX_SIZE: