From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.4 required=3.0 tests=BAYES_00,DATE_IN_PAST_24_48, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EAD40C433F5 for ; Mon, 20 Sep 2021 14:36:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CD9E4610CE for ; Mon, 20 Sep 2021 14:36:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240497AbhITOhr (ORCPT ); Mon, 20 Sep 2021 10:37:47 -0400 Received: from relay10.mail.gandi.net ([217.70.178.230]:46035 "EHLO relay10.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231952AbhITOhm (ORCPT ); Mon, 20 Sep 2021 10:37:42 -0400 Received: from h7.dl5rb.org.uk (p5790756f.dip0.t-ipconnect.de [87.144.117.111]) (Authenticated sender: ralf@linux-mips.org) by relay10.mail.gandi.net (Postfix) with ESMTPSA id 23D48240013; Mon, 20 Sep 2021 14:36:13 +0000 (UTC) Received: from h7.dl5rb.org.uk (localhost [127.0.0.1]) by h7.dl5rb.org.uk (8.16.1/8.16.1) with ESMTPS id 18KEaCgK1202531 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Mon, 20 Sep 2021 16:36:12 +0200 Received: (from ralf@localhost) by h7.dl5rb.org.uk (8.16.1/8.16.1/Submit) id 18KEaCuJ1202530; Mon, 20 Sep 2021 16:36:12 +0200 Message-Id: In-Reply-To: References: From: Ralf Baechle Date: Sun, 19 Sep 2021 15:30:26 +0200 Subject: [PATCH v2 2/6] AX.25: Print decoded addresses rather than hex numbers. To: Stephen Hemminger Cc: netdev@vger.kernel.org, linux-hams@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.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 --- 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