[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20080306110835.GA6802@gondor.apana.org.au>
Date: Thu, 6 Mar 2008 19:08:35 +0800
From: Herbert Xu <herbert@...dor.apana.org.au>
To: Joakim Koskela <joakim.koskela@...t.fi>
Cc: netdev@...r.kernel.org
Subject: Re: [PATCH] [XFRM] Beet: Fix output for ipv6
On Mon, Feb 25, 2008 at 10:31:00PM +0200, Joakim Koskela wrote:
> Hi Herbert,
>
> Have you had a chance to look this, or are you working on something else for
> it?
Sorry, I've been flat out lately so I missed your patch.
> On Friday 08 February 2008 18:12, Joakim Koskela wrote:
> >
> > This patch fixes the ipv6 mode of ipsec beet. It has been using logic
> > similar to tunnel mode, making it crash during esp packaging.
> >
> > Signed-off-by: Joakim Koskela <jookos@...il.com>
> > ---
> > net/ipv6/xfrm6_mode_beet.c | 9 ++++++---
> > 1 files changed, 6 insertions(+), 3 deletions(-)
> >
> > diff --git a/net/ipv6/xfrm6_mode_beet.c b/net/ipv6/xfrm6_mode_beet.c
> > index 0527d11..0395800 100644
> > --- a/net/ipv6/xfrm6_mode_beet.c
> > +++ b/net/ipv6/xfrm6_mode_beet.c
> > @@ -40,11 +40,14 @@ static void xfrm6_beet_make_header(struct sk_buff *skb)
> > static int xfrm6_beet_output(struct xfrm_state *x, struct sk_buff *skb)
> > {
> > struct ipv6hdr *top_iph;
> > + u8 *prevhdr;
> > + int hdr_len;
> >
> > + hdr_len = x->type->hdr_offset(x, skb, &prevhdr);
> > + skb_set_mac_header(skb, (prevhdr - x->props.header_len) - skb->data);
> > skb_set_network_header(skb, -x->props.header_len);
> > - skb->mac_header = skb->network_header +
> > - offsetof(struct ipv6hdr, nexthdr);
> > - skb->transport_header = skb->network_header + sizeof(*top_iph);
> > + skb->transport_header = skb->network_header + hdr_len;
> > + __skb_pull(skb, hdr_len);
After a quick a look I have to say that I don't think this is
right. BEET is supposed to wrap around all extension headers
so we shouldn't call hdr_offset. In fact the packet could be
IPv4 for all we know.
So why don't you show us the crash that you're experiencing?
Thanks,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@...dor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists