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:
parent
1717bcc6f4
commit
800af1fb81
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=144792
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user