From b2de5d10e38ecce8607e6b438b6d174f389a004e Mon Sep 17 00:00:00 2001 From: Sylvain Afchain Date: Sat, 14 Oct 2017 00:39:06 +0200 Subject: [PATCH] Add netnsid to link attrs --- link.go | 1 + link_linux.go | 2 ++ 2 files changed, 3 insertions(+) diff --git a/link.go b/link.go index 59f7ba5..5aa3a17 100644 --- a/link.go +++ b/link.go @@ -37,6 +37,7 @@ type LinkAttrs struct { EncapType string Protinfo *Protinfo OperState LinkOperState + NetNsID int } // LinkOperState represents the values of the IFLA_OPERSTATE link diff --git a/link_linux.go b/link_linux.go index fd8e4cd..e94fd97 100644 --- a/link_linux.go +++ b/link_linux.go @@ -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])) } }