ip: Fix ip -o link
authorStefan Sørensen <stefan.sorensen@spectralink.com>
Sat, 30 Mar 2019 17:24:46 +0000 (18:24 +0100)
committerDenys Vlasenko <vda.linux@googlemail.com>
Sat, 30 Mar 2019 17:24:46 +0000 (18:24 +0100)
Commit db169f253854db572c0c2b7e3d74ebbe6afdb97f breaks the "ip -o link"
command, no output is displayed.. Fix by only excluding the link info if
in oneline mode and if the address family is not AF_PACKET.

function                                             old     new   delta
ipaddr_list_or_flush                                1232    1202     -30

Signed-off-by: Stefan Sørensen <stefan.sorensen@spectralink.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
networking/libiproute/ipaddress.c

index d088caf4c4caf2872c94f0986c42096fc20088cf..0a1b5d79845b354bd6d153658e73b11170ad287f 100644 (file)
@@ -574,8 +574,8 @@ int FAST_FUNC ipaddr_list_or_flush(char **argv, int flush)
        }
 
        for (l = linfo; l; l = l->next) {
-               if (no_link
-                || (oneline || print_linkinfo(&l->h) == 0)
+               if ((oneline && G_filter.family != AF_PACKET)
+                || (print_linkinfo(&l->h) == 0)
                /* ^^^^^^^^^ "ip -oneline a" does not print link info */
                ) {
                        struct ifinfomsg *ifi = NLMSG_DATA(&l->h);