diff --git a/ip/ipaddress.c b/ip/ipaddress.c index 2aa5fbfb..e5398472 100644 --- a/ip/ipaddress.c +++ b/ip/ipaddress.c @@ -637,6 +637,25 @@ int print_linkinfo_brief(const struct sockaddr_nl *who, return -1; } + if (tb[IFLA_MASTER]) { + int master = *(int*)RTA_DATA(tb[IFLA_MASTER]); + if (filter.master > 0 && master != filter.master) + return -1; + } + else if (filter.master > 0) + return -1; + + if (filter.kind) { + if (tb[IFLA_LINKINFO]) { + char *kind = parse_link_kind(tb[IFLA_LINKINFO]); + + if (strcmp(kind, filter.kind)) + return -1; + } else { + return -1; + } + } + if (n->nlmsg_type == RTM_DELLINK) fprintf(fp, "Deleted ");