git: 07cf1ce012c5 - stable/14 - ndp: Fix libxo formatting for the header of neighbor cache

From: Zhenlei Huang <zlei_at_FreeBSD.org>
Date: Tue, 10 Sep 2024 10:02:49 UTC
The branch stable/14 has been updated by zlei:

URL: https://cgit.FreeBSD.org/src/commit/?id=07cf1ce012c51e30ef5078c23a7d68a9b5d87c0a

commit 07cf1ce012c51e30ef5078c23a7d68a9b5d87c0a
Author:     Helge Oldach <freebsd@oldach.net>
AuthorDate: 2024-09-02 10:12:43 +0000
Commit:     Zhenlei Huang <zlei@FreeBSD.org>
CommitDate: 2024-09-10 10:01:49 +0000

    ndp: Fix libxo formatting for the header of neighbor cache
    
    PR:             272749
    Reviewed by:    zlei
    Fixes:          e1c7783e220b ndp(8): add structured output formatting via libxo
    Fixes:          91fbe0819bb9 ndp: convert ndp(8) to netlink
    MFC after:      3 days
    
    (cherry picked from commit 209905ec384eedd58f1b9b7ab774029d22787dfb)
---
 usr.sbin/ndp/ndp.c         | 2 +-
 usr.sbin/ndp/ndp_netlink.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/usr.sbin/ndp/ndp.c b/usr.sbin/ndp/ndp.c
index 56c86e447cd5..a6f30911ddb4 100644
--- a/usr.sbin/ndp/ndp.c
+++ b/usr.sbin/ndp/ndp.c
@@ -634,7 +634,7 @@ dump_rtsock(struct sockaddr_in6 *addr, int cflag)
 	if (!opts.tflag && !cflag) {
 		char xobuf[200];
 		snprintf(xobuf, sizeof(xobuf),
-		    "{T:/%%-%d.%ds} {T:/%%-%d.%ds} {T:/%%%d.%ds} {T:/%%-9.9s} {T:%%1s} {T:%%5s}\n",
+		    "{T:/%%-%d.%ds} {T:/%%-%d.%ds} {T:/%%%d.%ds} {T:/%%-9.9s} {T:/%%1s} {T:/%%5s}\n",
 		    W_ADDR, W_ADDR, W_LL, W_LL, W_IF, W_IF);
 		xo_emit(xobuf, "Neighbor", "Linklayer Address", "Netif", "Expire", "S", "Flags");
 	}
diff --git a/usr.sbin/ndp/ndp_netlink.c b/usr.sbin/ndp/ndp_netlink.c
index 79bdec2356d0..179d715c8ded 100644
--- a/usr.sbin/ndp/ndp_netlink.c
+++ b/usr.sbin/ndp/ndp_netlink.c
@@ -341,7 +341,7 @@ print_entries_nl(uint32_t ifindex, struct sockaddr_in6 *addr, bool cflag)
 	if (!opts.tflag && !cflag) {
 		char xobuf[200];
 		snprintf(xobuf, sizeof(xobuf),
-		    "{T:/%%-%d.%ds} {T:/%%-%d.%ds} {T:/%%%d.%ds} {T:/%%-9.9s} {T:%%1s} {T:%%5s}\n",
+		    "{T:/%%-%d.%ds} {T:/%%-%d.%ds} {T:/%%%d.%ds} {T:/%%-9.9s} {T:/%%1s} {T:/%%5s}\n",
 		    W_ADDR, W_ADDR, W_LL, W_LL, W_IF, W_IF);
 		xo_emit(xobuf, "Neighbor", "Linklayer Address", "Netif", "Expire", "S", "Flags");
 	}