Add RFC3542-style checksum compuation on raw, IPv6 sockets

This patch adds support for RFC3542-style checksum computation on raw,
IPv6 sockets via the IPV6_CHECKSUM socket option.

This allows the development of application-layer utilities such as
ping6 which are unable to compute the raw packet checksum without a
prior knowledge of the source address selection.
This commit is contained in:
Grant Erickson
2012-12-19 18:21:07 -08:00
committed by Simon Goldschmidt
parent e2c2afbbe0
commit d74464e091
4 changed files with 102 additions and 1 deletions

View File

@@ -97,6 +97,11 @@ struct raw_pcb {
} recv;
/* user-supplied argument for the recv callback */
void *recv_arg;
#if LWIP_IPV6
/* fields for handling checksum computations as per RFC3542. */
u8_t chksum_reqd;
u16_t chksum_offset;
#endif
};
/* The following functions is the application layer interface to the

View File

@@ -230,7 +230,8 @@ struct linger {
/*
* Options for level IPPROTO_IPV6
*/
#define IPV6_V6ONLY 27 /* RFC3493: boolean control to restrict AF_INET6 sockets to IPv6 communications only. */
#define IPV6_CHECKSUM 7 /* RFC3542: calculate and insert the ICMPv6 checksum for raw sockets. */
#define IPV6_V6ONLY 27 /* RFC3493: boolean control to restrict AF_INET6 sockets to IPv6 communications only. */
#endif /* LWIP_IPV6 */
#if LWIP_UDP && LWIP_UDPLITE