]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/ipv4/xfrm4_mode_beet.c
Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6
[linux-2.6-omap-h63xx.git] / net / ipv4 / xfrm4_mode_beet.c
index 3650e027ce703306fcd15acd772fdeb6f88ed8d1..a73e710740c22396c4bff28337c53ea6b8624565 100644 (file)
@@ -29,7 +29,7 @@
  */
 static int xfrm4_beet_output(struct xfrm_state *x, struct sk_buff *skb)
 {
-       struct iphdr *iph, *top_iph = NULL;
+       struct iphdr *iph, *top_iph;
        int hdrlen, optlen;
 
        iph = ip_hdr(skb);
@@ -40,7 +40,7 @@ static int xfrm4_beet_output(struct xfrm_state *x, struct sk_buff *skb)
        if (unlikely(optlen))
                hdrlen += IPV4_BEET_PHMAXLEN - (optlen & 4);
 
-       skb_push(skb, x->props.header_len + hdrlen);
+       skb_push(skb, x->props.header_len - IPV4_BEET_PHMAXLEN + hdrlen);
        skb_reset_network_header(skb);
        top_iph = ip_hdr(skb);
        skb->transport_header += sizeof(*iph) - hdrlen;
@@ -73,11 +73,9 @@ static int xfrm4_beet_input(struct xfrm_state *x, struct sk_buff *skb)
        struct iphdr *iph = ip_hdr(skb);
        int phlen = 0;
        int optlen = 0;
-       __u8 ph_nexthdr = 0, protocol = 0;
+       u8 ph_nexthdr = 0;
        int err = -EINVAL;
 
-       protocol = iph->protocol;
-
        if (unlikely(iph->protocol == IPPROTO_BEETPH)) {
                struct ip_beet_phdr *ph;
 
@@ -109,8 +107,6 @@ static int xfrm4_beet_input(struct xfrm_state *x, struct sk_buff *skb)
        iph->saddr = x->sel.saddr.a4;
        if (ph_nexthdr)
                iph->protocol = ph_nexthdr;
-       else
-               iph->protocol = protocol;
        iph->check = 0;
        iph->check = ip_fast_csum(skb_network_header(skb), iph->ihl);
        err = 0;