mirror of
https://git.proxmox.com/git/mirror_iproute2
synced 2025-10-25 17:51:12 +00:00
ip link: show permanent hardware address
Display permanent hardware address of an interface in output of "ip link show" and "ip addr show". To reduce noise, permanent address is only shown if it is different from current one. Signed-off-by: Michal Kubecek <mkubecek@suse.cz> Signed-off-by: David Ahern <dsahern@gmail.com>
This commit is contained in:
parent
974f889c2d
commit
2b8e6995fe
@ -1011,6 +1011,24 @@ int print_linkinfo(struct nlmsghdr *n, void *arg)
|
||||
ifi->ifi_type,
|
||||
b1, sizeof(b1)));
|
||||
}
|
||||
if (tb[IFLA_PERM_ADDRESS]) {
|
||||
unsigned int len = RTA_PAYLOAD(tb[IFLA_PERM_ADDRESS]);
|
||||
|
||||
if (!tb[IFLA_ADDRESS] ||
|
||||
RTA_PAYLOAD(tb[IFLA_ADDRESS]) != len ||
|
||||
memcmp(RTA_DATA(tb[IFLA_PERM_ADDRESS]),
|
||||
RTA_DATA(tb[IFLA_ADDRESS]), len)) {
|
||||
print_string(PRINT_FP, NULL, " permaddr ", NULL);
|
||||
print_color_string(PRINT_ANY,
|
||||
COLOR_MAC,
|
||||
"permaddr",
|
||||
"%s",
|
||||
ll_addr_n2a(RTA_DATA(tb[IFLA_PERM_ADDRESS]),
|
||||
RTA_PAYLOAD(tb[IFLA_PERM_ADDRESS]),
|
||||
ifi->ifi_type,
|
||||
b1, sizeof(b1)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (tb[IFLA_LINK_NETNSID]) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user