o Nano optimize ip_reass() code path for the first fragment: do not

try to reasseble the packet from the fragments queue with the only
fragment, finish with the first fragment as soon as we create a queue.

Spotted by:	Vijay Singh

o Drop the fragment if maxfragsperpacket == 0, no chances we
will be able to reassemble the packet in future.

Reviewed by:	silby
This commit is contained in:
maxim 2005-04-08 10:25:13 +00:00
parent b54f449e43
commit 1d7537ad41

View File

@ -801,8 +801,8 @@ ip_reass(struct mbuf *m)
u_int8_t ecn, ecn0;
u_short hash;
/* If maxnipq is 0, never accept fragments. */
if (maxnipq == 0) {
/* If maxnipq or maxfragsperpacket are 0, never accept fragments. */
if (maxnipq == 0 || maxfragsperpacket == 0) {
ipstat.ips_fragments++;
ipstat.ips_fragdropped++;
m_freem(m);
@ -918,7 +918,7 @@ ip_reass(struct mbuf *m)
fp->ipq_dst = ip->ip_dst;
fp->ipq_frags = m;
m->m_nextpkt = NULL;
goto inserted;
goto done;
} else {
fp->ipq_nfrags++;
#ifdef MAC
@ -998,8 +998,6 @@ ip_reass(struct mbuf *m)
m_freem(q);
}
inserted:
/*
* Check for complete reassembly and perform frag per packet
* limiting.