summaryrefslogtreecommitdiff
path: root/sys/net
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2020-12-10 06:40:23 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2020-12-10 06:40:23 +0000
commit6452834053fdea85f291e2bd59dfc942c5cdea6d (patch)
tree77f495047636c3f247a92b72b40f1b438de929a2 /sys/net
parentf757c49af282ed9d9acf394d841aa6adc1b98112 (diff)
when setting a flowid, set the M_FLOWID csum_flags bit too.
this "fixes" TCP going over an interface with fq codel enabled. the way the codel code classifies a packet without a flowid set is to randomly assign it to a bucket. this in turn means that packets will get reordered, and tcp hates that. sthen was able to find a test case and narrow down at which time the problem appeared, helped greatly. tested by sthen@ and millert@ ok sashan@ jmatthew@
Diffstat (limited to 'sys/net')
-rw-r--r--sys/net/pf.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/net/pf.c b/sys/net/pf.c
index 4ac4cc45f78..f65b77aa487 100644
--- a/sys/net/pf.c
+++ b/sys/net/pf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pf.c,v 1.1095 2020/12/07 08:29:41 sashan Exp $ */
+/* $OpenBSD: pf.c,v 1.1096 2020/12/10 06:40:22 dlg Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
@@ -7183,8 +7183,10 @@ done:
pf_state_key_link_inpcb(s->key[PF_SK_STACK],
pd.m->m_pkthdr.pf.inp);
- if (s && (pd.m->m_pkthdr.csum_flags & M_FLOWID) == 0)
+ if (s != NULL && !ISSET(pd.m->m_pkthdr.csum_flags, M_FLOWID)) {
pd.m->m_pkthdr.ph_flowid = bemtoh64(&s->id);
+ SET(pd.m->m_pkthdr.csum_flags, M_FLOWID);
+ }
/*
* connections redirected to loopback should not match sockets