You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(net): Check whether ICMP embedded packet is full
Introduce a method to check whether the IP packet embedded inside of an
ICMP Error message is full.
This can be useful for NAT. As part of NAT, we should validate and
update the checksum for the inner IP and transport layers, but it's not
worth updating the checksum if the payload is not complete.
It's delicate to perform all checks required for this verification, and
we can't call the function just from any location, because we need to
access:
- The buffer containing the ICMP header, to extract the optional length
field to check for the presence of ICMP extensions (this field is not
exposed as part of the Icmpv4Header),
- The length comsummed when parsing headers for the embedded packet -
this is the best alternative we have to re-parsing the full IPv6
header to compute its length,
- The parsed data, in particular the total length (IPv4) or payload
length (IPv6) and header length (TCP), from the collected headers.
For this reason, we store the result as part of the EmbeddedHeaders
struct, so we can reuse it when necessary.
Signed-off-by: Quentin Monnet <[email protected]>
0 commit comments