mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-12-30 15:38:06 +01:00
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.
This commit is contained in:
parent
b164106fa7
commit
b53902964f
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=1813
@ -254,6 +254,16 @@ ip_output(m0, opt, ro, flags, imo)
|
||||
if (ip->ip_src.s_addr == INADDR_ANY)
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user