Date: Tue, 13 Oct 2009 23:21:52 +0000 (UTC) From: Ermal Luçi <eri@FreeBSD.org> To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r198063 - in user/eri/pf45/head/sys/contrib: altq/altq pf/net Message-ID: <200910132321.n9DNLqEH019688@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: eri Date: Tue Oct 13 23:21:52 2009 New Revision: 198063 URL: http://svn.freebsd.org/changeset/base/198063 Log: Unbreak ALTQ build. Modified: user/eri/pf45/head/sys/contrib/altq/altq/altq_red.c user/eri/pf45/head/sys/contrib/pf/net/pf.c user/eri/pf45/head/sys/contrib/pf/net/pf_ioctl.c user/eri/pf45/head/sys/contrib/pf/net/pfvar.h Modified: user/eri/pf45/head/sys/contrib/altq/altq/altq_red.c ============================================================================== --- user/eri/pf45/head/sys/contrib/altq/altq/altq_red.c Tue Oct 13 22:28:55 2009 (r198062) +++ user/eri/pf45/head/sys/contrib/altq/altq/altq_red.c Tue Oct 13 23:21:52 2009 (r198063) @@ -516,11 +516,9 @@ mark_ecn(struct mbuf *m, struct altq_pkt struct mbuf *m0; struct pf_mtag *at; void *hdr; - int af; at = pf_find_mtag(m); if (at != NULL) { - af = at->af; hdr = at->hdr; #ifdef ALTQ3_COMPAT } else if (pktattr != NULL) { @@ -530,9 +528,6 @@ mark_ecn(struct mbuf *m, struct altq_pkt } else return (0); - if (af != AF_INET && af != AF_INET6) - return (0); - /* verify that pattr_hdr is within the mbuf data */ for (m0 = m; m0 != NULL; m0 = m0->m_next) if (((caddr_t)hdr >= m0->m_data) && @@ -543,8 +538,8 @@ mark_ecn(struct mbuf *m, struct altq_pkt return (0); } - switch (af) { - case AF_INET: + switch (((struct ip *)hdr)->ip_v) { + case 4: if (flags & REDF_ECN4) { struct ip *ip = hdr; u_int8_t otos; @@ -577,7 +572,7 @@ mark_ecn(struct mbuf *m, struct altq_pkt } break; #ifdef INET6 - case AF_INET6: + case 6: if (flags & REDF_ECN6) { struct ip6_hdr *ip6 = hdr; u_int32_t flowlabel; Modified: user/eri/pf45/head/sys/contrib/pf/net/pf.c ============================================================================== --- user/eri/pf45/head/sys/contrib/pf/net/pf.c Tue Oct 13 22:28:55 2009 (r198062) +++ user/eri/pf45/head/sys/contrib/pf/net/pf.c Tue Oct 13 23:21:52 2009 (r198063) @@ -2246,9 +2246,16 @@ pf_send_tcp(const struct pf_rule *r, sa_ #ifdef ALTQ if (r != NULL && r->qid) { +#ifdef __FreeBSD__ + pf_mtag->qid = r->qid; + + /* add hints for ecn */ + pf_mtag->hdr = mtod(m, struct ip *); +#else m->m_pkthdr.pf.qid = r->qid; /* add hints for ecn */ m->m_pkthdr.pf.hdr = mtod(m, struct ip *); +#endif } #endif /* ALTQ */ m->m_data += max_linkhdr; @@ -6712,12 +6719,22 @@ done: #ifdef ALTQ if (action == PF_PASS && r->qid) { +#ifdef __FreeBSD__ + if (pqid || (pd.tos & IPTOS_LOWDELAY)) + pd.pf_mtag->qid = r->pqid; + else + pd.pf_mtag->qid = r->qid; + /* add hints for ecn */ + pd.pf_mtag->hdr = h; + +#else if (pqid || (pd.tos & IPTOS_LOWDELAY)) m->m_pkthdr.pf.qid = r->pqid; else m->m_pkthdr.pf.qid = r->qid; /* add hints for ecn */ m->m_pkthdr.pf.hdr = h; +#endif } #endif /* ALTQ */ @@ -6873,7 +6890,11 @@ pf_test6(int dir, struct ifnet *ifp, str struct pfi_kif *kif; u_short action, reason = 0, log = 0; struct mbuf *m = *m0, *n = NULL; +#ifdef __FreeBSD__ + struct ip6_hdr *h = NULL; +#else struct ip6_hdr *h; +#endif struct pf_rule *a = NULL, *r = &pf_default_rule, *tr, *nr; struct pf_state *s = NULL; struct pf_ruleset *ruleset = NULL; @@ -7232,12 +7253,21 @@ done: #ifdef ALTQ if (action == PF_PASS && r->qid) { +#ifdef __FreeBSD__ + if (pd.tos & IPTOS_LOWDELAY) + pd.pf_mtag->qid = r->pqid; + else + pd.pf_mtag->qid = r->qid; + /* add hints for ecn */ + pd.pf_mtag->hdr = h; +#else if (pd.tos & IPTOS_LOWDELAY) m->m_pkthdr.pf.qid = r->pqid; else m->m_pkthdr.pf.qid = r->qid; /* add hints for ecn */ m->m_pkthdr.pf.hdr = h; +#endif } #endif /* ALTQ */ Modified: user/eri/pf45/head/sys/contrib/pf/net/pf_ioctl.c ============================================================================== --- user/eri/pf45/head/sys/contrib/pf/net/pf_ioctl.c Tue Oct 13 22:28:55 2009 (r198062) +++ user/eri/pf45/head/sys/contrib/pf/net/pf_ioctl.c Tue Oct 13 23:21:52 2009 (r198063) @@ -192,7 +192,7 @@ VNET_DEFINE(struct pf_tags, pf_tags) = TAILQ_HEAD_INITIALIZER(V_pf_tags); VNET_DEFINE(struct pf_tags, pf_qids) = TAILQ_HEAD_INITIALIZER(pf_qids); -#define pf_qids VNET(pf_qids); +#define pf_qids VNET(pf_qids) #else /* !__FreeBSD__ */ struct pf_rule pf_default_rule; Modified: user/eri/pf45/head/sys/contrib/pf/net/pfvar.h ============================================================================== --- user/eri/pf45/head/sys/contrib/pf/net/pfvar.h Tue Oct 13 22:28:55 2009 (r198062) +++ user/eri/pf45/head/sys/contrib/pf/net/pfvar.h Tue Oct 13 23:21:52 2009 (r198063) @@ -1855,7 +1855,7 @@ extern void pf_tbladdr_copyout(struct extern void pf_calc_skip_steps(struct pf_rulequeue *); #ifdef __FreeBSD__ #ifdef ALTQ -VNET_DECLARE(void pf_altq_ifnet_event(struct ifnet *, int)); +extern void pf_altq_ifnet_event(struct ifnet *, int); #endif VNET_DECLARE(uma_zone_t, pf_src_tree_pl); #define pf_src_tree_pl VNET(pf_src_tree_pl)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200910132321.n9DNLqEH019688>