]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
NETROM: Print decoded addresses rather than hex numbers.
authorRalf Baechle <ralf@linux-mips.org>
Sun, 19 Sep 2021 13:30:26 +0000 (15:30 +0200)
committerDavid Ahern <dsahern@kernel.org>
Fri, 24 Sep 2021 02:02:40 +0000 (20:02 -0600)
NETROM is an OSI layer 3 protocol sitting on top of AX.25.  It also uses
AX.25 addresses.  Without this commit ip will print NETROM address like

  link/generic 98:92:9c:aa:b0:40:02 brd 00:00:00:00:00:00:00

while with this commit the decoded result

  link/generic LINUX-1 brd *

is much more eye friendly.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: David Ahern <dsahern@kernel.org>
lib/ll_addr.c

index 910e6daf9ffa8a93d841c8344d001ac22a9f581c..46e30c794c1041ea3467372b6a3aa4689b04d45b 100644 (file)
@@ -41,6 +41,8 @@ const char *ll_addr_n2a(const unsigned char *addr, int alen, int type,
                return inet_ntop(AF_INET6, addr, buf, blen);
        if (alen == 7 && type == ARPHRD_AX25)
                return ax25_ntop(AF_AX25, addr, buf, blen);
+       if (alen == 7 && type == ARPHRD_NETROM)
+               return netrom_ntop(AF_NETROM, addr, buf, blen);
 
        snprintf(buf, blen, "%02x", addr[0]);
        for (i = 1, l = 2; i < alen && l < blen; i++, l += 3)