All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ralf Baechle <ralf@linux-mips.org>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: netdev@vger.kernel.org, linux-hams@vger.kernel.org
Subject: [PATCH 2/6] AX.25: Print decoded addresses rather than hex numbers.
Date: Wed, 18 Jan 2017 23:08:21 +0100	[thread overview]
Message-ID: <474560d79e822f58c7c728ee0aaf86113e8d5ffd.1627295848.git.ralf@linux-mips.org> (raw)
In-Reply-To: <cover.1627295848.git.ralf@linux-mips.org>

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 <ralf@linux-mips.org>
---
 lib/ll_addr.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/ll_addr.c b/lib/ll_addr.c
index 00b562ae..910e6daf 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)
-- 
2.31.1



  parent reply	other threads:[~2021-07-26 19:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <cover.1627295848.git.ralf@linux-mips.org>
2017-01-18 21:34 ` [PATCH 6/6] ROSE: Print decoded addresses rather than hex numbers Ralf Baechle
2017-01-18 22:08 ` [PATCH 1/6] AX.25: Add ax25_ntop implementation Ralf Baechle
2017-01-18 22:08 ` Ralf Baechle [this message]
2017-01-18 22:19 ` [PATCH 4/6] NETROM: Print decoded addresses rather than hex numbers Ralf Baechle
2019-04-12 12:27 ` [PATCH 5/6] ROSE: Add rose_ntop implementation Ralf Baechle
2019-04-13 16:17 ` [PATCH 3/6] NETROM: Add netrom_ntop implementation Ralf Baechle

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=474560d79e822f58c7c728ee0aaf86113e8d5ffd.1627295848.git.ralf@linux-mips.org \
    --to=ralf@linux-mips.org \
    --cc=linux-hams@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=stephen@networkplumber.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.