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")
This commit is contained in:
Kristof Provost 2022-07-01 13:13:20 +02:00
parent 42db2dbbc5
commit ba3b6b938d
2 changed files with 3 additions and 2 deletions

View file

@ -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;

View file

@ -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