Commit 4f2e4ad5 authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller

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

Simply replace such checksum by 0xffff, regardless of transport.

This error was caught on SIT tunnels, but seems generic.
Signed-off-by: default avatarEric Dumazet <>
Cc: Maciej Żenczykowski <>
Cc: Willem de Bruijn <>
Acked-by: default avatarMaciej Żenczykowski <>
Signed-off-by: default avatarDavid S. Miller <>
parent e551c32d
......@@ -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;
skb->ip_summed = CHECKSUM_NONE;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment