summaryrefslogtreecommitdiff
path: root/sys/altq
diff options
context:
space:
mode:
Diffstat (limited to 'sys/altq')
-rw-r--r--sys/altq/altq_cbq.c9
-rw-r--r--sys/altq/altq_hfsc.c9
-rw-r--r--sys/altq/altq_priq.c9
3 files changed, 24 insertions, 3 deletions
diff --git a/sys/altq/altq_cbq.c b/sys/altq/altq_cbq.c
index 0eb98af1dfd..70db136f942 100644
--- a/sys/altq/altq_cbq.c
+++ b/sys/altq/altq_cbq.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: altq_cbq.c,v 1.13 2003/03/02 11:22:31 henning Exp $ */
+/* $OpenBSD: altq_cbq.c,v 1.14 2003/03/11 02:25:59 kjc Exp $ */
/* $KAME: altq_cbq.c,v 1.9 2000/12/14 08:12:45 thorpej Exp $ */
/*
@@ -492,6 +492,13 @@ cbq_enqueue(struct ifaltq *ifq, struct mbuf *m, struct altq_pktattr *pktattr)
int len;
/* grab class set by classifier */
+ if ((m->m_flags & M_PKTHDR) == 0) {
+ /* should not happen */
+ printf("altq: packet for %s does not have pkthdr\n",
+ ifq->altq_ifp->if_xname);
+ m_freem(m);
+ return (ENOBUFS);
+ }
t = m_tag_find(m, PACKET_TAG_PF_QID, NULL);
if (t == NULL ||
(cl = clh_to_clp(cbqp, ((struct altq_tag *)(t+1))->qid)) == NULL) {
diff --git a/sys/altq/altq_hfsc.c b/sys/altq/altq_hfsc.c
index eb844cb7daa..369b6c8f240 100644
--- a/sys/altq/altq_hfsc.c
+++ b/sys/altq/altq_hfsc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: altq_hfsc.c,v 1.10 2003/03/02 11:22:31 henning Exp $ */
+/* $OpenBSD: altq_hfsc.c,v 1.11 2003/03/11 02:25:59 kjc Exp $ */
/* $KAME: altq_hfsc.c,v 1.17 2002/11/29 07:48:33 kjc Exp $ */
/*
@@ -615,6 +615,13 @@ hfsc_enqueue(ifq, m, pktattr)
int len;
/* grab class set by classifier */
+ if ((m->m_flags & M_PKTHDR) == 0) {
+ /* should not happen */
+ printf("altq: packet for %s does not have pkthdr\n",
+ ifq->altq_ifp->if_xname);
+ m_freem(m);
+ return (ENOBUFS);
+ }
t = m_tag_find(m, PACKET_TAG_PF_QID, NULL);
if (t == NULL ||
(cl = clh_to_clp(hif, ((struct altq_tag *)(t+1))->qid)) == NULL ||
diff --git a/sys/altq/altq_priq.c b/sys/altq/altq_priq.c
index 109686b4826..29acd1ce910 100644
--- a/sys/altq/altq_priq.c
+++ b/sys/altq/altq_priq.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: altq_priq.c,v 1.10 2003/03/02 11:22:31 henning Exp $ */
+/* $OpenBSD: altq_priq.c,v 1.11 2003/03/11 02:25:59 kjc Exp $ */
/* $KAME: altq_priq.c,v 1.1 2000/10/18 09:15:23 kjc Exp $ */
/*
* Copyright (C) 2000
@@ -409,6 +409,13 @@ priq_enqueue(struct ifaltq *ifq, struct mbuf *m, struct altq_pktattr *pktattr)
int len;
/* grab class set by classifier */
+ if ((m->m_flags & M_PKTHDR) == 0) {
+ /* should not happen */
+ printf("altq: packet for %s does not have pkthdr\n",
+ ifq->altq_ifp->if_xname);
+ m_freem(m);
+ return (ENOBUFS);
+ }
t = m_tag_find(m, PACKET_TAG_PF_QID, NULL);
if (t == NULL ||
(cl = clh_to_clp(pif, ((struct altq_tag *)(t+1))->qid)) == NULL) {