Good time of day,

  Following diff removes testing queue id against zero, because
of which default queue packets (seems to) passed to ALTQ w/o header
hint (m_pkthdr.pf.hdr), so their headers can't be inspected or altered
by ALTQ (with RED/ECN, for example).

  Diff against -current. Tested on 4.5 

Index: pf.c
===================================================================
RCS file: /cvs/src/sys/net/pf.c,v
retrieving revision 1.680
diff -u -r1.680 pf.c
--- pf.c        24 Dec 2009 04:24:19 -0000      1.680
+++ pf.c        11 Jan 2010 05:57:38 -0000
@@ -1971,7 +1971,7 @@
        m->m_pkthdr.rdomain = rdom;
 
 #ifdef ALTQ
-       if (r != NULL && r->qid) {
+       if (r != NULL) {
                m->m_pkthdr.pf.qid = r->qid;
                /* add hints for ecn */
                m->m_pkthdr.pf.hdr = mtod(m, struct ip *);
@@ -2094,11 +2094,9 @@
        m0->m_pkthdr.rdomain = rdomain;
 
 #ifdef ALTQ
-       if (r->qid) {
-               m0->m_pkthdr.pf.qid = r->qid;
-               /* add hints for ecn */
-               m0->m_pkthdr.pf.hdr = mtod(m0, struct ip *);
-       }
+       m0->m_pkthdr.pf.qid = r->qid;
+       /* add hints for ecn */
+       m0->m_pkthdr.pf.hdr = mtod(m0, struct ip *);
 #endif /* ALTQ */
 
        switch (af) {
@@ -5712,7 +5710,7 @@
                m->m_pkthdr.pf.statekey = s->key[PF_SK_STACK];
 
 #ifdef ALTQ
-       if (action == PF_PASS && qid) {
+       if (action == PF_PASS) {
                m->m_pkthdr.pf.qid = qid;
                m->m_pkthdr.pf.hdr = h; /* hints for ecn */
        }
@@ -6156,7 +6154,7 @@
                m->m_pkthdr.pf.statekey = s->key[PF_SK_STACK];
 
 #ifdef ALTQ
-       if (action == PF_PASS && s && s->qid) {
+       if (action == PF_PASS && s) {
                if (pd.tos & IPTOS_LOWDELAY)
                        m->m_pkthdr.pf.qid = s->pqid;
                else

Kind regards,

Ilya A. Kovalenko
SA, SpecialEQ SW sections
JSC "Oganer-Service"  

Reply via email to