git: 6b46a577c33e - stable/12 - ipfilter: Obtain the interface name more efficiently

From: Cy Schubert <cy_at_FreeBSD.org>
Date: Thu, 10 Mar 2022 00:33:40 UTC
The branch stable/12 has been updated by cy:

URL: https://cgit.FreeBSD.org/src/commit/?id=6b46a577c33e8e158e3115e06a58654d79e93ffe

commit 6b46a577c33e8e158e3115e06a58654d79e93ffe
Author:     Cy Schubert <cy@FreeBSD.org>
AuthorDate: 2022-03-03 06:40:18 +0000
Commit:     Cy Schubert <cy@FreeBSD.org>
CommitDate: 2022-03-10 00:33:20 +0000

    ipfilter: Obtain the interface name more efficiently
    
    Rather than use a kmem read to determine the interface name used by a
    nat_t structure through a pointer, nat_ipfs->netif->if_xname, obtain it
    directly from nat_ifnames in the nat_t structure itself using the new
    FORMAT_IF macro.
    
    (cherry picked from commit ec793543feff027f0de9dff3708ab86f5e567d15)
---
 sbin/ipf/libipf/printactivenat.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sbin/ipf/libipf/printactivenat.c b/sbin/ipf/libipf/printactivenat.c
index 3a6337ab0f7b..222f85a5818b 100644
--- a/sbin/ipf/libipf/printactivenat.c
+++ b/sbin/ipf/libipf/printactivenat.c
@@ -124,8 +124,8 @@ printactivenat(nat_t *nat, int opts, u_long ticks)
 			getsumd(nat->nat_sumd[1]),
 			nat->nat_pr[0], nat->nat_pr[1],
 			nat->nat_hv[0], nat->nat_hv[1], nat->nat_flags);
-		PRINTF("\tifp %s", getifname(nat->nat_ifps[0]));
-		PRINTF(",%s ", getifname(nat->nat_ifps[1]));
+		PRINTF("\tifp %s,%s ", FORMAT_IF(nat->nat_ifnames[0]),
+			FORMAT_IF(nat->nat_ifnames[1]));
 #ifdef	USE_QUAD_T
 		PRINTF("bytes %"PRIu64"/%"PRIu64" pkts %"PRIu64"/%"PRIu64"",
 			(unsigned long long)nat->nat_bytes[0],