Include interface name in container-addrs output

This commit is contained in:
Adam Harrison committed 2016-05-06 14:12:50 +01:00
1 parent ad5845b67f
commit 260b416cd7
3 files changed
+10 -9

No files matched your search

+2 -1
View File
@@ -45,6 +45,7 @@ func WithNetNS(ns netns.NsHandle, work func() error) error {
}
type NetDev struct {
Name string
MAC net.HardwareAddr
CIDRs []*net.IPNet
}
@@ -97,7 +98,7 @@ func linkToNetDev(link netlink.Link) (*NetDev, error) {
return nil, err
}
netDev := &NetDev{MAC: link.Attrs().HardwareAddr}
netDev := &NetDev{Name: link.Attrs().Name, MAC: link.Attrs().HardwareAddr}
for _, addr := range addrs {
netDev.CIDRs = append(netDev.CIDRs, addr.IPNet)
}