git: 35ddf84138b4 - stable/13 - ipfilter: Introduce the new FORMAT_IF macro

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

URL: https://cgit.FreeBSD.org/src/commit/?id=35ddf84138b4165437cf18a3540c4a9aa12f4860

commit 35ddf84138b4165437cf18a3540c4a9aa12f4860
Author:     Cy Schubert <cy@FreeBSD.org>
AuthorDate: 2022-03-03 06:21:59 +0000
Commit:     Cy Schubert <cy@FreeBSD.org>
CommitDate: 2022-03-10 00:31:40 +0000

    ipfilter: Introduce the new FORMAT_IF macro
    
    Interface names stored in the ipstate_t and ipnat_t structures can be
    NULL. This occurs when an application, such as named, is running on the
    firewall machine itself. For example an application, i.e. named, running
    on the firewall itself will cause a state table display and NAT mapping
    display to show a null ingress interface and its egress interface. This
    is perfectly valid but confusing to human eyes. Rather than print
    nothing, print "(null)".
    
    (cherry picked from commit 915395a2800a09a64ae41ca96eabcb5e16b44309)
---
 sbin/ipf/common/ipf.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sbin/ipf/common/ipf.h b/sbin/ipf/common/ipf.h
index e178cfc1676e..b278d8ec5d6c 100644
--- a/sbin/ipf/common/ipf.h
+++ b/sbin/ipf/common/ipf.h
@@ -103,6 +103,7 @@ typedef unsigned int	u_32_t;
 
 #define	PRINTF	(void)printf
 #define	FPRINTF	(void)fprintf
+#define FORMAT_IF(_a)	(_a != NULL ? _a : "(null)")
 
 
 struct	ipopt_names	{