mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2026-05-30 22:43:54 +08:00
ipv6 reassembly: fix detecting holes in reassembled packets
Added unit test for reassembly. See bug #64767
This commit is contained in:
@@ -447,6 +447,19 @@ ip6_reass(struct pbuf *p)
|
||||
}
|
||||
}
|
||||
#endif /* IP_REASS_CHECK_OVERLAP */
|
||||
/* Check if the fragments received so far have no gaps. */
|
||||
if (iprh_prev != NULL) {
|
||||
if (iprh_prev->end != start) {
|
||||
/* There is a fragment missing between the current
|
||||
* and the previous fragment */
|
||||
valid = 0;
|
||||
}
|
||||
}
|
||||
if (end != iprh_tmp->start) {
|
||||
/* There is a fragment missing between the current
|
||||
* and the following fragment */
|
||||
valid = 0;
|
||||
}
|
||||
/* the new pbuf should be inserted before this */
|
||||
next_pbuf = q;
|
||||
if (iprh_prev != NULL) {
|
||||
@@ -658,6 +671,7 @@ ip6_reass(struct pbuf *p)
|
||||
}
|
||||
|
||||
/* Return the pbuf chain */
|
||||
MIB2_STATS_INC(mib2.ip6reasmoks);
|
||||
return p;
|
||||
}
|
||||
/* the datagram is not (yet?) reassembled completely */
|
||||
|
||||
@@ -122,7 +122,7 @@ struct stats_sys {
|
||||
|
||||
/** SNMP MIB2 stats */
|
||||
struct stats_mib2 {
|
||||
/* IP */
|
||||
/* IPv4 */
|
||||
u32_t ipinhdrerrors;
|
||||
u32_t ipinaddrerrors;
|
||||
u32_t ipinunknownprotos;
|
||||
@@ -140,6 +140,9 @@ struct stats_mib2 {
|
||||
u32_t ipforwdatagrams;
|
||||
u32_t ipinreceives;
|
||||
|
||||
/* IPv6 */
|
||||
u32_t ip6reasmoks;
|
||||
|
||||
/* TCP */
|
||||
u32_t tcpactiveopens;
|
||||
u32_t tcppassiveopens;
|
||||
|
||||
Reference in New Issue
Block a user