aboutsummaryrefslogtreecommitdiff
path: root/sys/netinet6
diff options
context:
space:
mode:
authorBill Paul <wpaul@FreeBSD.org>2004-05-14 03:57:17 +0000
committerBill Paul <wpaul@FreeBSD.org>2004-05-14 03:57:17 +0000
commit6f8aee22681c9a4b16edbcdb4411e35b59a3a27a (patch)
treeacf57da54960cf7c1a7e07a08e28c5f569478068 /sys/netinet6
parent15a3ddef19dfbbff023d10ad4282bd0e7900fb61 (diff)
Notes
Diffstat (limited to 'sys/netinet6')
-rw-r--r--sys/netinet6/ip6_output.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/sys/netinet6/ip6_output.c b/sys/netinet6/ip6_output.c
index 5e0105cba63b9..b955f40e28056 100644
--- a/sys/netinet6/ip6_output.c
+++ b/sys/netinet6/ip6_output.c
@@ -1044,6 +1044,7 @@ skip_ipsec2:;
u_char nextproto;
struct ip6ctlparam ip6cp;
u_int32_t mtu32;
+ int qslots = ifp->if_snd.ifq_maxlen - ifp->if_snd.ifq_len;
/*
* Too large for the destination or interface;
@@ -1068,6 +1069,17 @@ skip_ipsec2:;
goto bad;
}
+ /*
+ * Verify that we have any chance at all of being able to queue
+ * the packet or packet fragments
+ */
+ if (qslots <= 0 || ((u_int)qslots * (mtu - hlen)
+ < tlen /* - hlen */)) {
+ error = ENOBUFS;
+ ip6stat.ip6s_odropped++;
+ goto bad;
+ }
+
mnext = &m->m_nextpkt;
/*