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:
Alessandro Boch 2016-09-20 16:53:49 -07:00 committed by Vish Ishaya
parent 63381f39fc
commit da7420cab5
2 changed files with 2 additions and 1 deletions

View File

@ -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

View File

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