From: Ralf Baechle Date: Sun, 19 Sep 2021 13:30:26 +0000 (+0200) Subject: AX.25: Print decoded addresses rather than hex numbers. X-Git-Tag: v5.16.0~34^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=399ae00af5c5c2cbe96b1b802797ee24df9c5e45;p=thirdparty%2Fiproute2.git AX.25: Print decoded addresses rather than hex numbers. Before this, ip would have printed the AX.25 address configured for an AX.25 interface's default addresses as: link/ax25 98:92:9c:aa:b0:40:02 brd a2:a6:a8:40:40:40:00 which is pretty unreadable. With this commit ip will decode AX.25 addresses like link/ax25 LINUX-1 brd QST-0 Signed-off-by: Ralf Baechle Signed-off-by: David Ahern --- diff --git a/lib/ll_addr.c b/lib/ll_addr.c index 00b562aed..910e6daf9 100644 --- a/lib/ll_addr.c +++ b/lib/ll_addr.c @@ -39,6 +39,8 @@ const char *ll_addr_n2a(const unsigned char *addr, int alen, int type, if (alen == 16 && (type == ARPHRD_TUNNEL6 || type == ARPHRD_IP6GRE)) return inet_ntop(AF_INET6, addr, buf, blen); + if (alen == 7 && type == ARPHRD_AX25) + return ax25_ntop(AF_AX25, addr, buf, blen); snprintf(buf, blen, "%02x", addr[0]); for (i = 1, l = 2; i < alen && l < blen; i++, l += 3)