diff options
author | silby <silby@FreeBSD.org> | 2003-02-01 05:59:51 +0000 |
---|---|---|
committer | silby <silby@FreeBSD.org> | 2003-02-01 05:59:51 +0000 |
commit | 34fa6078b2e0f3a0c678d71e0c6a2ce5188ef4ef (patch) | |
tree | 83369d7cc94b6aa496b3e7b66e6f09cb955c7543 /sys | |
parent | b6a07e6e733ffaf2d17a73717b2f137c945acd18 (diff) | |
download | FreeBSD-src-34fa6078b2e0f3a0c678d71e0c6a2ce5188ef4ef.zip FreeBSD-src-34fa6078b2e0f3a0c678d71e0c6a2ce5188ef4ef.tar.gz |
Move a comment and optimize the frag timeout code a slight bit.
Submitted by: maxim
MFC with: The previous two revisions
Diffstat (limited to 'sys')
-rw-r--r-- | sys/netinet/ip_input.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c index 5ab31c7..1965b02 100644 --- a/sys/netinet/ip_input.c +++ b/sys/netinet/ip_input.c @@ -722,6 +722,7 @@ ours: */ if (ip->ip_off & (IP_MF | IP_OFFMASK)) { + /* If maxnipq is 0, never accept fragments. */ if (maxnipq == 0) { ipstat.ips_fragments++; ipstat.ips_fragdropped++; @@ -748,7 +749,6 @@ ours: /* * Enforce upper bound on number of fragmented packets * for which we attempt reassembly; - * If maxnipq is 0, never accept fragments. (Handled above.) * If maxnipq is -1, accept all fragments without limitation. */ if ((nipq > maxnipq) && (maxnipq > 0)) { @@ -1216,8 +1216,8 @@ ip_slowtimo() * (due to the limit being lowered), drain off * enough to get down to the new limit. */ - for (i = 0; i < IPREASS_NHASH; i++) { - if (maxnipq >= 0) { + if (maxnipq > 0 && nipq > maxnipq) { + for (i = 0; i < IPREASS_NHASH; i++) { while (nipq > maxnipq && !TAILQ_EMPTY(&ipq[i])) { ipstat.ips_fragdropped++; |