]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - net/ipv4/xfrm4_mode_beet.c
3c59x: fix build failure on !CONFIG_PCI
[net-next-2.6.git] / net / ipv4 / xfrm4_mode_beet.c
index 9c798abce736c5afdb78aaccb3d26f1ce08ad307..63418185f5249aaba6a8ae55be365536a56397a1 100644 (file)
@@ -47,8 +47,10 @@ static int xfrm4_beet_output(struct xfrm_state *x, struct sk_buff *skb)
        if (unlikely(optlen))
                hdrlen += IPV4_BEET_PHMAXLEN - (optlen & 4);
 
-       skb_set_network_header(skb, IPV4_BEET_PHMAXLEN - x->props.header_len -
-                                   hdrlen);
+       skb_set_network_header(skb, -x->props.header_len -
+                                   hdrlen + (XFRM_MODE_SKB_CB(skb)->ihl - sizeof(*top_iph)));
+       if (x->sel.family != AF_INET6)
+               skb->network_header += IPV4_BEET_PHMAXLEN;
        skb->mac_header = skb->network_header +
                          offsetof(struct iphdr, protocol);
        skb->transport_header = skb->network_header + sizeof(*top_iph);