mirror of
https://github.com/vishvananda/netlink
synced 2024-12-28 09:32:17 +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
|
||||
HardwareAddr net.HardwareAddr
|
||||
Flags net.Flags
|
||||
RawFlags uint32
|
||||
ParentIndex int // index of the parent link device
|
||||
MasterIndex int // must be the index of a bridge
|
||||
Namespace interface{} // nil | NsPid | NsFd
|
||||
|
@ -936,7 +936,7 @@ func linkDeserialize(m []byte) (Link, error) {
|
||||
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 {
|
||||
base.Promisc = 1
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user