Hello!
> According to RFC2292 and its successor RFC2292bis, kernel compute and
> store checksum for output, and verify the recieved checksum on input
> (and discard it if it is in error) if the socket is for ICMPv6 IPV6_CHECKSUM
> socket option is set to the raw socket.
> Linux does not support this.
This is supposed to be fixed in recent 2.4.19 and 2.5.
> (1) RFC2292bis denies usage of this interface for ICMPv6 socket,
OK. Yes, we can set default value for such sockets to 2, but I do not see
any good reasons to limit functionality of the API just to follow evident
mistake in the rfc. So, I would apply the last three chunks of the patch
except for these lines:
+ if (sk->num == IPPROTO_ICMPV6 && val != 2)
+ return(-EINVAL);
One question only: what did you mean in the following chunk?
Apparently, you forgot to delete marked line.
csum = (__u16 *) (buff + opt->offset);
*csum = hdr->cksum;
^^^^^^^^^^^^^^^^^^^
+ if (*csum) {
+ /* in case cksum was not initialized */
+ __u32 sum = hdr->cksum;
+ sum += *csum;
+ *csum = hdr->cksum = (sum + (sum>>16));
+ } else {
+ *csum = hdr->cksum;
+ }
Do I guess correctly that you wanted to compensate for occasionally
ununitialized checksum bits in data supplied by user?
Alexey
|