This patch fixes the following issues related to the IPPROTO_IPV6 level socket option IPV6_CHECKSUM:
- When setting the offset, don't allow negative values except -1, since they are not supported.
- When receiving a packet with an incorrect checksum, just discard it and don't send an ICMP message indicating a parameter problem.
- When computing the checksum for a packet to be sent, ensure you have enough bytes in the packet to write the checksum. The existing check was wrong (off by one error) and would result in writing one byte after the packet buffer.
- When computing the checksum for a received packet, ensure that you have enough bytes in the packet such that it contains the checksum. This fixes in particular syzbot, which was injecting an empty (plen = 0) packet, which resulted in a panic.