aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Greenman <dg@FreeBSD.org>1994-08-01 12:01:45 +0000
committerDavid Greenman <dg@FreeBSD.org>1994-08-01 12:01:45 +0000
commitb53902964f16213c213357c7befd5168e04acd66 (patch)
tree39ec6015a22b769173bcfa25488922d34e259fc6
parentb164106fa7c50fde58d3824ec0ea34590700ba21 (diff)
downloadsrc-b53902964f16213c213357c7befd5168e04acd66.tar.gz
src-b53902964f16213c213357c7befd5168e04acd66.zip
fixed bug where large amounts of unidirectional UDP traffic would fill
the interface output queue and further udp packets would be fragmented and only partially sent - keeping the output queue full and jamming the network, but not actually getting any real work done (because you can't send just 'part' of a udp packet - if you fragment it, you must send the whole thing). The fix involves adding a check to make sure that the output queue has sufficient space for all of the fragments.
Notes
Notes: svn path=/head/; revision=1813
-rw-r--r--sys/netinet/ip_output.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c
index 1fb1481c3110..89c6de4ad594 100644
--- a/sys/netinet/ip_output.c
+++ b/sys/netinet/ip_output.c
@@ -255,6 +255,16 @@ ip_output(m0, opt, ro, flags, imo)
ip->ip_src = IA_SIN(ia)->sin_addr;
#endif
/*
+ * Verify that we have any chance at all of being able to queue
+ * the packet or packet fragments
+ */
+ if ((ifp->if_snd.ifq_len + ip->ip_len / ifp->if_mtu + 1) >=
+ ifp->if_snd.ifq_maxlen) {
+ error = ENOBUFS;
+ goto bad;
+ }
+
+ /*
* Look for broadcast address and
* and verify user is allowed to send
* such a packet.