diff options
author | dg <dg@FreeBSD.org> | 1994-08-01 12:01:45 +0000 |
---|---|---|
committer | dg <dg@FreeBSD.org> | 1994-08-01 12:01:45 +0000 |
commit | d54d08937b64f2364e9dddc83fb7db1bac55ca5a (patch) | |
tree | 39ec6015a22b769173bcfa25488922d34e259fc6 /sys | |
parent | f55740d974a2ef80ddd0accc039bee47b82632ca (diff) | |
download | FreeBSD-src-d54d08937b64f2364e9dddc83fb7db1bac55ca5a.zip FreeBSD-src-d54d08937b64f2364e9dddc83fb7db1bac55ca5a.tar.gz |
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.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/netinet/ip_output.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c index 1fb1481..89c6de4 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. |