mirror of
https://github.com/vishvananda/netlink
synced 2025-01-16 12:01:54 +00:00
Expose link's raw flags (#165)
- This is needed so that caller can check link's operational states. Signed-off-by: Alessandro Boch <aboch@docker.com>
This commit is contained in:
parent
63381f39fc
commit
da7420cab5
1
link.go
1
link.go
@ -26,6 +26,7 @@ type LinkAttrs struct {
|
|||||||
Name string
|
Name string
|
||||||
HardwareAddr net.HardwareAddr
|
HardwareAddr net.HardwareAddr
|
||||||
Flags net.Flags
|
Flags net.Flags
|
||||||
|
RawFlags uint32
|
||||||
ParentIndex int // index of the parent link device
|
ParentIndex int // index of the parent link device
|
||||||
MasterIndex int // must be the index of a bridge
|
MasterIndex int // must be the index of a bridge
|
||||||
Namespace interface{} // nil | NsPid | NsFd
|
Namespace interface{} // nil | NsPid | NsFd
|
||||||
|
@ -936,7 +936,7 @@ func linkDeserialize(m []byte) (Link, error) {
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
base := LinkAttrs{Index: int(msg.Index), Flags: linkFlags(msg.Flags)}
|
base := LinkAttrs{Index: int(msg.Index), RawFlags: msg.Flags, Flags: linkFlags(msg.Flags)}
|
||||||
if msg.Flags&syscall.IFF_PROMISC != 0 {
|
if msg.Flags&syscall.IFF_PROMISC != 0 {
|
||||||
base.Promisc = 1
|
base.Promisc = 1
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user