Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=254d0d24e31c3df64ccfff349c9aa9d1e5989819
Commit:     254d0d24e31c3df64ccfff349c9aa9d1e5989819
Parent:     d4b1e840629562953d81c9fe0a3a67473f3d993c
Author:     Patrick McHardy <[EMAIL PROTECTED]>
AuthorDate: Thu Apr 5 16:03:33 2007 -0700
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Thu Apr 5 16:03:33 2007 -0700

    [XFRM]: beet: fix IP option decapsulation
    
    Beet mode looks for the beet pseudo header after the outer IP header,
    which is wrong since that is followed by the ESP header. Additionally
    it needs to adjust the packet length after removing the pseudo header
    and point the data pointer to the real data location.
    
    Signed-off-by: Patrick McHardy <[EMAIL PROTECTED]>
    Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 net/ipv4/xfrm4_mode_beet.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/net/ipv4/xfrm4_mode_beet.c b/net/ipv4/xfrm4_mode_beet.c
index b94775a..f68dfd8 100644
--- a/net/ipv4/xfrm4_mode_beet.c
+++ b/net/ipv4/xfrm4_mode_beet.c
@@ -78,10 +78,11 @@ static int xfrm4_beet_input(struct xfrm_state *x, struct 
sk_buff *skb)
        protocol = iph->protocol;
 
        if (unlikely(iph->protocol == IPPROTO_BEETPH)) {
-               struct ip_beet_phdr *ph = (struct ip_beet_phdr*)(iph + 1);
+               struct ip_beet_phdr *ph;
 
                if (!pskb_may_pull(skb, sizeof(*ph)))
                        goto out;
+               ph = (struct ip_beet_phdr *)(skb->h.ipiph + 1);
 
                phlen = sizeof(*ph) + ph->padlen;
                optlen = ph->hdrlen * 8 - phlen;
@@ -90,6 +91,7 @@ static int xfrm4_beet_input(struct xfrm_state *x, struct 
sk_buff *skb)
 
                if (!pskb_may_pull(skb, phlen + optlen))
                        goto out;
+               skb->len -= phlen + optlen;
 
                ph_nexthdr = ph->nexthdr;
        }
@@ -97,6 +99,7 @@ static int xfrm4_beet_input(struct xfrm_state *x, struct 
sk_buff *skb)
        skb->nh.raw = skb->data + (phlen - sizeof(*iph));
        memmove(skb->nh.raw, iph, sizeof(*iph));
        skb->h.raw = skb->data + (phlen + optlen);
+       skb->data = skb->h.raw;
 
        iph = skb->nh.iph;
        iph->ihl = (sizeof(*iph) + optlen) / 4;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to