From a16732d670fa6013bc085a5f9bf6b8d2c208de98 Mon Sep 17 00:00:00 2001 From: Kristof Provost Date: Tue, 12 Apr 2022 13:29:56 +0200 Subject: [PATCH] pfctl: always print 'l3' source/destination While the kernel only performs the L3 check for ETHERTYPE_IP/ETHERTYPE_IP6 we should always print the source and destination addresses. Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D34918 --- sbin/pfctl/pfctl_parser.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/sbin/pfctl/pfctl_parser.c b/sbin/pfctl/pfctl_parser.c index 1bd95b076ce..1f6a194591c 100644 --- a/sbin/pfctl/pfctl_parser.c +++ b/sbin/pfctl/pfctl_parser.c @@ -783,12 +783,10 @@ print_eth_rule(struct pfctl_eth_rule *r, const char *anchor_call, printf(" to "); print_eth_addr(&r->dst); } - if (r->proto == ETHERTYPE_IP || r->proto == ETHERTYPE_IPV6) { - printf(" l3"); - print_fromto(&r->ipsrc, PF_OSFP_ANY, &r->ipdst, - r->proto == ETHERTYPE_IP ? AF_INET : AF_INET6, 0, - 0, 0); - } + printf(" l3"); + print_fromto(&r->ipsrc, PF_OSFP_ANY, &r->ipdst, + r->proto == ETHERTYPE_IP ? AF_INET : AF_INET6, 0, + 0, 0); if (r->qname[0]) printf(" queue %s", r->qname); if (r->tagname[0])