udpv6: Fix gso_size setting in ip6_ufo_append_data
authorSridhar Samudrala <sri@us.ibm.com>
Thu, 9 Jul 2009 08:09:58 +0000 (08:09 +0000)
committerDavid S. Miller <davem@davemloft.net>
Sun, 12 Jul 2009 21:29:26 +0000 (14:29 -0700)
- fix gso_size setting for ipv6 fragment to be a multiple of 8 bytes.

Signed-off-by: Sridhar Samudrala <sri@us.ibm.com>
Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv6/ip6_output.c

index 7c76e3d1821551c42acc16d3e2210404a553b4d0..1c6f0fc43690fa52559539c801bc1c379a39c999 100644 (file)
@@ -1087,9 +1087,11 @@ static inline int ip6_ufo_append_data(struct sock *sk,
        if (!err) {
                struct frag_hdr fhdr;
 
-               /* specify the length of each IP datagram fragment*/
-               skb_shinfo(skb)->gso_size = mtu - fragheaderlen -
-                                           sizeof(struct frag_hdr);
+               /* Specify the length of each IPv6 datagram fragment.
+                * It has to be a multiple of 8.
+                */
+               skb_shinfo(skb)->gso_size = (mtu - fragheaderlen -
+                                            sizeof(struct frag_hdr)) & ~7;
                skb_shinfo(skb)->gso_type = SKB_GSO_UDP;
                ipv6_select_ident(skb, &fhdr);
                skb_shinfo(skb)->ip6_frag_id = fhdr.identification;