Skip to content

Commit

Permalink
ipv6: ip6_fragment() should check CHECKSUM_PARTIAL
Browse files Browse the repository at this point in the history
Quoting Tore Anderson from :

If the allfrag feature has been set on a host route (due to an ICMPv6
Packet Too Big received indicating a MTU of less than 1280),
TCP SYN/ACK packets to that destination appears to get an incorrect
TCP checksum. This in turn means they are thrown away as invalid.

In the case of an IPv4 client behind a link with a MTU of less than
1260, accessing an IPv6 server through a stateless translator,
this means that the client can only download a single large file
from the server, because once it is in the server's routing cache
with the allfrag feature set, new TCP connections can no longer
be established.

</endquote>

It appears ip6_fragment() doesn't handle CHECKSUM_PARTIAL properly.

As network drivers are not prepared to fetch correct transport header, a
safe fix is to call skb_checksum_help() before fragmenting packet.

Reported-by: Tore Anderson <[email protected]>
Signed-off-by: Eric Dumazet <[email protected]>
Tested-by: Tore Anderson <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Eric Dumazet authored and davem330 committed May 19, 2012
1 parent 6fba180 commit 72e843b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions net/ipv6/ip6_output.c
Original file line number Diff line number Diff line change
Expand Up @@ -788,6 +788,10 @@ int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *))
}

slow_path:
if ((skb->ip_summed == CHECKSUM_PARTIAL) &&
skb_checksum_help(skb))
goto fail;

left = skb->len - hlen; /* Space per frame */
ptr = hlen; /* Where to start from */

Expand Down

0 comments on commit 72e843b

Please sign in to comment.