[git commit] ip: fix "ip -oneline a"

Denys Vlasenko vda.linux at googlemail.com
Thu Mar 8 14:55:07 UTC 2018


commit: https://git.busybox.net/busybox/commit/?id=db169f253854db572c0c2b7e3d74ebbe6afdb97f
branch: https://git.busybox.net/busybox/commit/?id=refs/heads/master

Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
---
 networking/libiproute/ipaddress.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/networking/libiproute/ipaddress.c b/networking/libiproute/ipaddress.c
index d7f888176..9ec665b69 100644
--- a/networking/libiproute/ipaddress.c
+++ b/networking/libiproute/ipaddress.c
@@ -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);


More information about the busybox-cvs mailing list