ip: fix "ip -oneline a"
authorDenys Vlasenko <vda.linux@googlemail.com>
Thu, 8 Mar 2018 14:55:07 +0000 (15:55 +0100)
committerDenys Vlasenko <vda.linux@googlemail.com>
Thu, 8 Mar 2018 14:55:07 +0000 (15:55 +0100)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
networking/libiproute/ipaddress.c

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