From 915395a2800a09a64ae41ca96eabcb5e16b44309 Mon Sep 17 00:00:00 2001 From: Cy Schubert Date: Wed, 2 Mar 2022 22:21:59 -0800 Subject: [PATCH] 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)". MFC after: 1 week --- 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 e178cfc1676..b278d8ec5d6 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 {