mirror of
https://github.com/vishvananda/netlink.git
synced 2025-09-26 20:01:13 +08:00
Add IFLA_PARENT_DEV_NAME / IFLA_PARENT_DEV_BUS_NAME to links
These attributes are supported since kernel v5.14 (see [1]). Here's
what iproute2 shows:
```
$ ip -d link show eth0
4: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 65535 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000
... parentbus virtio parentdev virtio0
```
[1]: 00e77ed8e6
Signed-off-by: Albin Kerouanton <albinker@gmail.com>
This commit is contained in:

committed by
Alessandro Boch

parent
3642538757
commit
7c2350bd14
2
link.go
2
link.go
@@ -56,6 +56,8 @@ type LinkAttrs struct {
|
||||
Vfs []VfInfo // virtual functions available on link
|
||||
Group uint32
|
||||
PermHWAddr net.HardwareAddr
|
||||
ParentDev string
|
||||
ParentDevBus string
|
||||
Slave LinkSlave
|
||||
}
|
||||
|
||||
|
@@ -2263,6 +2263,10 @@ func LinkDeserialize(hdr *unix.NlMsghdr, m []byte) (Link, error) {
|
||||
break
|
||||
}
|
||||
}
|
||||
case unix.IFLA_PARENT_DEV_NAME:
|
||||
base.ParentDev = string(attr.Value[:len(attr.Value)-1])
|
||||
case unix.IFLA_PARENT_DEV_BUS_NAME:
|
||||
base.ParentDevBus = string(attr.Value[:len(attr.Value)-1])
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user