git: ba3b6b938db7 - main - pf: handle dummynet for non-IP packets
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 01 Jul 2022 12:40:32 UTC
The branch main has been updated by kp:
URL: https://cgit.FreeBSD.org/src/commit/?id=ba3b6b938db71a18a93cf88979af0e57136787bd
commit ba3b6b938db71a18a93cf88979af0e57136787bd
Author: Kristof Provost <kp@FreeBSD.org>
AuthorDate: 2022-07-01 11:13:20 +0000
Commit: Kristof Provost <kp@FreeBSD.org>
CommitDate: 2022-07-01 12:31:57 +0000
pf: handle dummynet for non-IP packets
Do not panic if we try to dummynet an Ethernet packet that's not IPv4 or
IPv6. Simply give it to dummynet.
Sponsored by: Rubicon Communications, LLC ("Netgate")
---
sys/netpfil/pf/pf.c | 2 --
tests/sys/netpfil/pf/ether.sh | 3 +++
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c
index d9664404e6e3..d82ec5eafd3c 100644
--- a/sys/netpfil/pf/pf.c
+++ b/sys/netpfil/pf/pf.c
@@ -4094,8 +4094,6 @@ pf_test_eth_rule(int dir, struct pfi_kkif *kif, struct mbuf **m0)
dnflow.f_id.src_ip6 = src->v6;
dnflow.f_id.dst_ip6 = dst->v6;
break;
- default:
- panic("Unknown address family");
}
mtag->flags |= PF_TAG_DUMMYNET;
diff --git a/tests/sys/netpfil/pf/ether.sh b/tests/sys/netpfil/pf/ether.sh
index 549fbf22ab7b..7fd55a5d78b5 100644
--- a/tests/sys/netpfil/pf/ether.sh
+++ b/tests/sys/netpfil/pf/ether.sh
@@ -419,6 +419,9 @@ dummynet_body()
pft_set_rules alcatraz \
"ether pass in dnpipe 1"
+ # Ensure things don't break if non-IP(v4/v6) traffic hits dummynet
+ arp -d 192.0.2.2
+
# single ping succeeds just fine
atf_check -s exit:0 -o ignore ping -c 1 192.0.2.2