Move ip_reassemble()'s use of the global M_FRAG mbuf flag to a protocol layer
specific flag instead. The flag is only relevant while the packet stays in the IP reassembly queue. Discussed with: trociny, glebius
This commit is contained in:
parent
fb86dfcd2f
commit
b09dc7e328
@ -911,9 +911,9 @@ ip_reass(struct mbuf *m)
|
|||||||
IPSTAT_INC(ips_toosmall); /* XXX */
|
IPSTAT_INC(ips_toosmall); /* XXX */
|
||||||
goto dropfrag;
|
goto dropfrag;
|
||||||
}
|
}
|
||||||
m->m_flags |= M_FRAG;
|
m->m_flags |= M_IP_FRAG;
|
||||||
} else
|
} else
|
||||||
m->m_flags &= ~M_FRAG;
|
m->m_flags &= ~M_IP_FRAG;
|
||||||
ip->ip_off = htons(ntohs(ip->ip_off) << 3);
|
ip->ip_off = htons(ntohs(ip->ip_off) << 3);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -1060,7 +1060,7 @@ ip_reass(struct mbuf *m)
|
|||||||
next += ntohs(GETIP(q)->ip_len);
|
next += ntohs(GETIP(q)->ip_len);
|
||||||
}
|
}
|
||||||
/* Make sure the last packet didn't have the IP_MF flag */
|
/* Make sure the last packet didn't have the IP_MF flag */
|
||||||
if (p->m_flags & M_FRAG) {
|
if (p->m_flags & M_IP_FRAG) {
|
||||||
if (fp->ipq_nfrags > V_maxfragsperpacket) {
|
if (fp->ipq_nfrags > V_maxfragsperpacket) {
|
||||||
IPSTAT_ADD(ips_fragdropped, fp->ipq_nfrags);
|
IPSTAT_ADD(ips_fragdropped, fp->ipq_nfrags);
|
||||||
ip_freef(head, fp);
|
ip_freef(head, fp);
|
||||||
|
@ -167,6 +167,7 @@ void kmod_ipstat_dec(int statnum);
|
|||||||
*/
|
*/
|
||||||
#define M_FASTFWD_OURS M_PROTO1 /* changed dst to local */
|
#define M_FASTFWD_OURS M_PROTO1 /* changed dst to local */
|
||||||
#define M_IP_NEXTHOP M_PROTO2 /* explicit ip nexthop */
|
#define M_IP_NEXTHOP M_PROTO2 /* explicit ip nexthop */
|
||||||
|
#define M_IP_FRAG M_PROTO4 /* fragment reassembly */
|
||||||
|
|
||||||
#ifdef __NO_STRICT_ALIGNMENT
|
#ifdef __NO_STRICT_ALIGNMENT
|
||||||
#define IP_HDR_ALIGNED_P(ip) 1
|
#define IP_HDR_ALIGNED_P(ip) 1
|
||||||
|
Loading…
Reference in New Issue
Block a user