Hi,

We've been maintaining this small patch since 5.8 and it seems to work as expected but could be wrong.

Unpatched Behaviour:

* netflow always shows TOS values as 0

Patched behaviour:

* netflow now shows a TOS value when either set by the PF rule, or if packet originally had the

Index: pf.c
===================================================================
RCS file: /cvs/src/sys/net/pf.c,v
retrieving revision 1.1037
diff -u -p -r1.1037 pf.c
--- pf.c    4 Jul 2017 14:10:15 -0000    1.1037
+++ pf.c    2 Aug 2017 00:51:34 -0000
@@ -2756,7 +2756,7 @@ pf_build_tcp(const struct pf_rule *r, sa
         h->ip_len = htons(tlen);
         h->ip_v = 4;
         h->ip_hl = sizeof(*h) >> 2;
-        h->ip_tos = IPTOS_LOWDELAY;
+        h->ip_tos = r->tos;
         h->ip_len = htons(len);
         h->ip_off = htons(ip_mtudisc ? IP_DF : 0);
         h->ip_ttl = ttl ? ttl : ip_defttl;

Index: pf.c
===================================================================
RCS file: /cvs/src/sys/net/pf.c,v
retrieving revision 1.1037
diff -u -p -r1.1037 pf.c
--- pf.c        4 Jul 2017 14:10:15 -0000       1.1037
+++ pf.c        2 Aug 2017 00:51:34 -0000
@@ -2756,7 +2756,7 @@ pf_build_tcp(const struct pf_rule *r, sa
                h->ip_len = htons(tlen);
                h->ip_v = 4;
                h->ip_hl = sizeof(*h) >> 2;
-               h->ip_tos = IPTOS_LOWDELAY;
+               h->ip_tos = r->tos;
                h->ip_len = htons(len);
                h->ip_off = htons(ip_mtudisc ? IP_DF : 0);
                h->ip_ttl = ttl ? ttl : ip_defttl;

Reply via email to