OSDN Git Service

ipv6: fix illegal mac_header comparison on 32bit
authorHannes Frederic Sowa <hannes@stressinduktion.org>
Fri, 13 Dec 2013 14:12:27 +0000 (15:12 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 15 Jan 2014 23:28:47 +0000 (15:28 -0800)
Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
include/linux/skbuff.h
net/ipv6/udp_offload.c

index 74db47e..ded45ec 100644 (file)
@@ -1741,6 +1741,11 @@ static inline void skb_set_mac_header(struct sk_buff *skb, const int offset)
 }
 #endif /* NET_SKBUFF_DATA_USES_OFFSET */
 
+static inline void skb_pop_mac_header(struct sk_buff *skb)
+{
+       skb->mac_header = skb->network_header;
+}
+
 static inline void skb_probe_transport_header(struct sk_buff *skb,
                                              const int offset_hint)
 {
index 76f165e..3696aa2 100644 (file)
@@ -85,7 +85,7 @@ static struct sk_buff *udp6_ufo_fragment(struct sk_buff *skb,
 
        /* Check if there is enough headroom to insert fragment header. */
        tnl_hlen = skb_tnl_header_len(skb);
-       if (skb->mac_header < (tnl_hlen + frag_hdr_sz)) {
+       if (skb_mac_header(skb) < skb->head + tnl_hlen + frag_hdr_sz) {
                if (gso_pskb_expand_head(skb, tnl_hlen + frag_hdr_sz))
                        goto out;
        }