aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKristof Provost <kp@FreeBSD.org>2025-01-22 10:56:09 +0000
committerKristof Provost <kp@FreeBSD.org>2025-01-24 10:20:31 +0000
commit06a6ec55fbd01a372778870cb5039341bdea9e38 (patch)
tree6dc3bafef974130acbcebb2d5a5b35c49472acf6
parent7a372bded8126b41608fd0eac550606bafe57a11 (diff)
pf: ignore/preserve ECN bits on ToS matching and scrubbing
The lower 2 bits of the tos-header are used for ECN. (http://tools.ietf.org/html/rfc2474#section-3) OK henning@, haesbaert@ Obtained from: OpenBSD, mpf <mpf@openbsd.org>, 60dfe711ee Sponsored by: Rubicon Communications, LLC ("Netgate")
-rw-r--r--sys/netpfil/pf/pf.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c
index a0bc65e78430..0ebc813756f1 100644
--- a/sys/netpfil/pf/pf.c
+++ b/sys/netpfil/pf/pf.c
@@ -9986,7 +9986,7 @@ pf_setup_pdesc(sa_family_t af, int dir, struct pf_pdesc *pd, struct mbuf **m0,
pd->dst = (struct pf_addr *)&h->ip_dst;
pd->ip_sum = &h->ip_sum;
pd->virtual_proto = pd->proto = h->ip_p;
- pd->tos = h->ip_tos;
+ pd->tos = h->ip_tos & ~IPTOS_ECN_MASK;
pd->ttl = h->ip_ttl;
pd->tot_len = ntohs(h->ip_len);
pd->act.rtableid = -1;