mirror of
https://github.com/freebsd/freebsd-src.git
synced 2026-10-28 11:25:21 +01:00
pfsync: handle large MTU pfsync interfaces
pfsync packets were allocated with m_get2(), which can't return packets
larger than MJUMPAGESIZE. As a result 9k MTU pfsync interfaces simply didn't work.
Use m_get3(), which can allocate sufficiently large mbufs.
Extend the pfsync:bulk test case to provoke this problem.
PR: 297307
MFC after: 2 weeks
Sponsored by: Rubicon Communications, LLC ("Netgate")
This commit is contained in:
1 parent
8ea4e92945
commit
7e2781fdcf
2 files changed
+9
-4
No files matched your search
@@ -2039,7 +2039,7 @@ pfsync_sendout(int schedswi, int c)
|
||||
return;
|
||||
}
|
||||
|
||||
m = m_get2(max_linkhdr + b->b_len, M_NOWAIT, MT_DATA, M_PKTHDR);
|
||||
m = m_get3(max_linkhdr + b->b_len, M_NOWAIT, MT_DATA, M_PKTHDR);
|
||||
if (m == NULL) {
|
||||
if_inc_counter(sc->sc_ifp, IFCOUNTER_OERRORS, 1);
|
||||
V_pfsyncstats.pfsyncs_onomem++;
|
||||
|
||||
@@ -212,13 +212,14 @@ bulk_body()
|
||||
|
||||
# pfsync interface
|
||||
jexec one ifconfig ${epair_sync}a 192.0.2.1/24 up
|
||||
jexec one ifconfig ${epair_sync}a mtu 9000
|
||||
jexec one ifconfig ${epair_one}a 198.51.100.1/24 up
|
||||
jexec one ifconfig pfsync0 \
|
||||
syncdev ${epair_sync}a \
|
||||
maxupd 1\
|
||||
up
|
||||
up mtu 9000
|
||||
jexec two ifconfig ${epair_two}a 198.51.100.2/24 up
|
||||
jexec two ifconfig ${epair_sync}b 192.0.2.2/24 up
|
||||
jexec two ifconfig ${epair_sync}b mtu 9000
|
||||
|
||||
# Enable pf
|
||||
jexec one pfctl -e
|
||||
@@ -232,7 +233,11 @@ bulk_body()
|
||||
|
||||
ifconfig ${epair_one}b 198.51.100.254/24 up
|
||||
|
||||
# Create state prior to setting up pfsync
|
||||
# Create states prior to setting up pfsync
|
||||
${common_dir}/pft_synflood.py \
|
||||
--sendif ${epair_one}b \
|
||||
--to 198.51.100.1 \
|
||||
--count 2500
|
||||
ping -c 1 -S 198.51.100.254 198.51.100.1
|
||||
|
||||
# Wait before setting up pfsync on two, so we don't accidentally catch
|
||||
|
||||
Reference in new issue
Block a user