mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-22 00:40:03 +00:00
net: mangle zero checksum in skb_checksum_help()
Sending zero checksum is ok for TCP, but not for UDP. UDPv6 receiver should by default drop a frame with a 0 checksum, and UDPv4 would not verify the checksum and might accept a corrupted packet. Simply replace such checksum by 0xffff, regardless of transport. This error was caught on SIT tunnels, but seems generic. Signed-off-by: Eric Dumazet <edumazet@google.com> Cc: Maciej Żenczykowski <maze@google.com> Cc: Willem de Bruijn <willemb@google.com> Acked-by: Maciej Żenczykowski <maze@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
e551c32d57
commit
4f2e4ad56a
1 changed files with 1 additions and 1 deletions
|
@ -2484,7 +2484,7 @@ int skb_checksum_help(struct sk_buff *skb)
|
|||
goto out;
|
||||
}
|
||||
|
||||
*(__sum16 *)(skb->data + offset) = csum_fold(csum);
|
||||
*(__sum16 *)(skb->data + offset) = csum_fold(csum) ?: CSUM_MANGLED_0;
|
||||
out_set_summed:
|
||||
skb->ip_summed = CHECKSUM_NONE;
|
||||
out:
|
||||
|
|
Loading…
Reference in a new issue