* ipcomp regression in 2.6.24
@ 2008-01-28 19:00 Beschorner Daniel
2008-01-29 8:07 ` Marco Berizzi
0 siblings, 1 reply; 11+ messages in thread
From: Beschorner Daniel @ 2008-01-28 19:00 UTC (permalink / raw)
To: netdev
Has someone an idea which patch could have damaged ipcomp?
Daniel
> With 2.6.24 IPSEC/ESP tunnels to older kernels establish fine, data
> flows in both directions, but no data comes out of the tunnel.
> Needed to disable ipcomp.
^ permalink raw reply [flat|nested] 11+ messages in thread* Re: ipcomp regression in 2.6.24 2008-01-28 19:00 ipcomp regression in 2.6.24 Beschorner Daniel @ 2008-01-29 8:07 ` Marco Berizzi 2008-01-30 3:15 ` Herbert Xu 0 siblings, 1 reply; 11+ messages in thread From: Marco Berizzi @ 2008-01-29 8:07 UTC (permalink / raw) To: Beschorner Daniel; +Cc: netdev Beschorner Daniel wrote: > Has someone an idea which patch could have damaged ipcomp? > > Daniel > > > With 2.6.24 IPSEC/ESP tunnels to older kernels establish fine, data > > flows in both directions, but no data comes out of the tunnel. > > Needed to disable ipcomp. Same problem here: linux 2.6.24 driven by openswan 2.4.11 on Slackware 11.0 ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: ipcomp regression in 2.6.24 2008-01-29 8:07 ` Marco Berizzi @ 2008-01-30 3:15 ` Herbert Xu 2008-01-30 5:12 ` David Miller 2008-01-30 9:14 ` Marco Berizzi 0 siblings, 2 replies; 11+ messages in thread From: Herbert Xu @ 2008-01-30 3:15 UTC (permalink / raw) To: davem, Marco Berizzi; +Cc: Daniel.Beschorner, netdev Marco Berizzi <pupilla@hotmail.com> wrote: > >> > With 2.6.24 IPSEC/ESP tunnels to older kernels establish fine, data >> > flows in both directions, but no data comes out of the tunnel. >> > Needed to disable ipcomp. > > Same problem here: linux 2.6.24 driven by openswan 2.4.11 > on Slackware 11.0 My bad. This patch should fix it. [IPCOMP]: Fetch nexthdr before ipch is destroyed When I moved the nexthdr setting out of IPComp I accidently moved the reading of ipch->nexthdr after the decompression. Unfortunately this means that we'd be reading from a stale ipch pointer which doesn't work very well. This patch moves the reading up so that we get the correct nexthdr value. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Cheers, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt -- diff --git a/net/ipv4/ipcomp.c b/net/ipv4/ipcomp.c index f4af99a..b79cdbe 100644 --- a/net/ipv4/ipcomp.c +++ b/net/ipv4/ipcomp.c @@ -74,6 +74,7 @@ out: static int ipcomp_input(struct xfrm_state *x, struct sk_buff *skb) { + int nexthdr; int err = -ENOMEM; struct ip_comp_hdr *ipch; @@ -84,13 +85,15 @@ static int ipcomp_input(struct xfrm_state *x, struct sk_buff *skb) /* Remove ipcomp header and decompress original payload */ ipch = (void *)skb->data; + nexthdr = ipch->nexthdr; + skb->transport_header = skb->network_header + sizeof(*ipch); __skb_pull(skb, sizeof(*ipch)); err = ipcomp_decompress(x, skb); if (err) goto out; - err = ipch->nexthdr; + err = nexthdr; out: return err; diff --git a/net/ipv6/ipcomp6.c b/net/ipv6/ipcomp6.c index b276d04..710325e 100644 --- a/net/ipv6/ipcomp6.c +++ b/net/ipv6/ipcomp6.c @@ -64,6 +64,7 @@ static LIST_HEAD(ipcomp6_tfms_list); static int ipcomp6_input(struct xfrm_state *x, struct sk_buff *skb) { + int nexthdr; int err = -ENOMEM; struct ip_comp_hdr *ipch; int plen, dlen; @@ -79,6 +80,8 @@ static int ipcomp6_input(struct xfrm_state *x, struct sk_buff *skb) /* Remove ipcomp header and decompress original payload */ ipch = (void *)skb->data; + nexthdr = ipch->nexthdr; + skb->transport_header = skb->network_header + sizeof(*ipch); __skb_pull(skb, sizeof(*ipch)); @@ -108,7 +111,7 @@ static int ipcomp6_input(struct xfrm_state *x, struct sk_buff *skb) skb->truesize += dlen - plen; __skb_put(skb, dlen - plen); skb_copy_to_linear_data(skb, scratch, dlen); - err = ipch->nexthdr; + err = nexthdr; out_put_cpu: put_cpu(); ^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: ipcomp regression in 2.6.24 2008-01-30 3:15 ` Herbert Xu @ 2008-01-30 5:12 ` David Miller 2008-02-08 9:12 ` Marco Berizzi 2008-01-30 9:14 ` Marco Berizzi 1 sibling, 1 reply; 11+ messages in thread From: David Miller @ 2008-01-30 5:12 UTC (permalink / raw) To: herbert; +Cc: pupilla, Daniel.Beschorner, netdev From: Herbert Xu <herbert@gondor.apana.org.au> Date: Wed, 30 Jan 2008 14:15:33 +1100 > Marco Berizzi <pupilla@hotmail.com> wrote: > > > >> > With 2.6.24 IPSEC/ESP tunnels to older kernels establish fine, data > >> > flows in both directions, but no data comes out of the tunnel. > >> > Needed to disable ipcomp. > > > > Same problem here: linux 2.6.24 driven by openswan 2.4.11 > > on Slackware 11.0 > > My bad. This patch should fix it. > > [IPCOMP]: Fetch nexthdr before ipch is destroyed > > When I moved the nexthdr setting out of IPComp I accidently moved > the reading of ipch->nexthdr after the decompression. Unfortunately > this means that we'd be reading from a stale ipch pointer which > doesn't work very well. > > This patch moves the reading up so that we get the correct nexthdr > value. > > Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Applied, and queued for -stable, thanks! ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: ipcomp regression in 2.6.24 2008-01-30 5:12 ` David Miller @ 2008-02-08 9:12 ` Marco Berizzi 2008-02-08 9:51 ` David Miller 0 siblings, 1 reply; 11+ messages in thread From: Marco Berizzi @ 2008-02-08 9:12 UTC (permalink / raw) To: David Miller; +Cc: netdev David Miller wrote: > From: Herbert Xu <herbert@gondor.apana.org.au> > Date: Wed, 30 Jan 2008 14:15:33 +1100 > > > Marco Berizzi <pupilla@hotmail.com> wrote: > > > > > >> > With 2.6.24 IPSEC/ESP tunnels to older kernels establish fine, data > > >> > flows in both directions, but no data comes out of the tunnel. > > >> > Needed to disable ipcomp. > > > > > > Same problem here: linux 2.6.24 driven by openswan 2.4.11 > > > on Slackware 11.0 > > > > My bad. This patch should fix it. > > > > [IPCOMP]: Fetch nexthdr before ipch is destroyed > > > > When I moved the nexthdr setting out of IPComp I accidently moved > > the reading of ipch->nexthdr after the decompression. Unfortunately > > this means that we'd be reading from a stale ipch pointer which > > doesn't work very well. > > > > This patch moves the reading up so that we get the correct nexthdr > > value. > > > > Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> > > Applied, and queued for -stable, thanks! Hi David, I haven't seen this patch in Greg 2.6.24-stable review message. ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: ipcomp regression in 2.6.24 2008-02-08 9:12 ` Marco Berizzi @ 2008-02-08 9:51 ` David Miller 0 siblings, 0 replies; 11+ messages in thread From: David Miller @ 2008-02-08 9:51 UTC (permalink / raw) To: pupilla; +Cc: netdev From: "Marco Berizzi" <pupilla@hotmail.com> Date: Fri, 8 Feb 2008 10:12:25 +0100 > I haven't seen this patch in Greg 2.6.24-stable > review message. Due to having just returned from LCA08 I haven't made any -stable submissions in a while, and I notified Greg of this tonight. The networking fixes will make it into the next 2.6.24.x release. ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: ipcomp regression in 2.6.24 2008-01-30 3:15 ` Herbert Xu 2008-01-30 5:12 ` David Miller @ 2008-01-30 9:14 ` Marco Berizzi 2008-01-31 5:32 ` Herbert Xu 1 sibling, 1 reply; 11+ messages in thread From: Marco Berizzi @ 2008-01-30 9:14 UTC (permalink / raw) To: Herbert Xu, davem; +Cc: Daniel.Beschorner, netdev Herbert Xu wrote: > Marco Berizzi <pupilla@hotmail.com> wrote: > > > >> > With 2.6.24 IPSEC/ESP tunnels to older kernels establish fine, data > >> > flows in both directions, but no data comes out of the tunnel. > >> > Needed to disable ipcomp. > > > > Same problem here: linux 2.6.24 driven by openswan 2.4.11 > > on Slackware 11.0 > > My bad. This patch should fix it. Sorry for bother you again. I have applied to 2.6.24, but ipcomp doesn't work anyway. I have patched a clean 2.6.24 tree and I did a complete rebuild. With tcpdump I see both the esp packets going in/out but I don't see the clear packets on the interface. ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: ipcomp regression in 2.6.24 2008-01-30 9:14 ` Marco Berizzi @ 2008-01-31 5:32 ` Herbert Xu 2008-01-31 5:48 ` David Miller 2008-01-31 8:37 ` Marco Berizzi 0 siblings, 2 replies; 11+ messages in thread From: Herbert Xu @ 2008-01-31 5:32 UTC (permalink / raw) To: Marco Berizzi; +Cc: davem, Daniel.Beschorner, netdev On Wed, Jan 30, 2008 at 10:14:46AM +0100, Marco Berizzi wrote: > > Sorry for bother you again. > I have applied to 2.6.24, but ipcomp doesn't work anyway. > I have patched a clean 2.6.24 tree and I did a complete > rebuild. > With tcpdump I see both the esp packets going in/out but > I don't see the clear packets on the interface. After testing it here it looks like there is this little typo which means that you can't actually use IPComp for anything that's not compressible :) [IPCOMP]: Fix reception of incompressible packets I made a silly typo by entering IPPROTO_IP (== 0) instead of IPPROTO_IPIP (== 4). This broke the reception of incompressible packets. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Cheers, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt -- diff --git a/net/ipv4/xfrm4_tunnel.c b/net/ipv4/xfrm4_tunnel.c index 3268451..152f83d 100644 --- a/net/ipv4/xfrm4_tunnel.c +++ b/net/ipv4/xfrm4_tunnel.c @@ -50,7 +50,7 @@ static struct xfrm_type ipip_type = { static int xfrm_tunnel_rcv(struct sk_buff *skb) { - return xfrm4_rcv_spi(skb, IPPROTO_IP, ip_hdr(skb)->saddr); + return xfrm4_rcv_spi(skb, IPPROTO_IPIP, ip_hdr(skb)->saddr); } static int xfrm_tunnel_err(struct sk_buff *skb, u32 info) ^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: ipcomp regression in 2.6.24 2008-01-31 5:32 ` Herbert Xu @ 2008-01-31 5:48 ` David Miller 2008-01-31 8:37 ` Marco Berizzi 1 sibling, 0 replies; 11+ messages in thread From: David Miller @ 2008-01-31 5:48 UTC (permalink / raw) To: herbert; +Cc: pupilla, Daniel.Beschorner, netdev From: Herbert Xu <herbert@gondor.apana.org.au> Date: Thu, 31 Jan 2008 16:32:21 +1100 > [IPCOMP]: Fix reception of incompressible packets > > I made a silly typo by entering IPPROTO_IP (== 0) instead of > IPPROTO_IPIP (== 4). This broke the reception of incompressible > packets. > > Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Applied, thanks! ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: ipcomp regression in 2.6.24 2008-01-31 5:32 ` Herbert Xu 2008-01-31 5:48 ` David Miller @ 2008-01-31 8:37 ` Marco Berizzi 2008-01-31 12:00 ` Beschorner Daniel 1 sibling, 1 reply; 11+ messages in thread From: Marco Berizzi @ 2008-01-31 8:37 UTC (permalink / raw) To: Herbert Xu; +Cc: davem, Daniel.Beschorner, netdev Herbert Xu wrote: > On Wed, Jan 30, 2008 at 10:14:46AM +0100, Marco Berizzi wrote: > > > > Sorry for bother you again. > > I have applied to 2.6.24, but ipcomp doesn't work anyway. > > I have patched a clean 2.6.24 tree and I did a complete > > rebuild. > > With tcpdump I see both the esp packets going in/out but > > I don't see the clear packets on the interface. > > After testing it here it looks like there is this little typo > which means that you can't actually use IPComp for anything > that's not compressible :) applied and tested to 2.6.24: ipcomp is working now. As always, thanks a lot Herbert for fixing this. ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: ipcomp regression in 2.6.24 2008-01-31 8:37 ` Marco Berizzi @ 2008-01-31 12:00 ` Beschorner Daniel 0 siblings, 0 replies; 11+ messages in thread From: Beschorner Daniel @ 2008-01-31 12:00 UTC (permalink / raw) To: Marco Berizzi, Herbert Xu; +Cc: davem, netdev > applied and tested to 2.6.24: ipcomp is working now. > As always, thanks a lot Herbert for fixing this. Thank you too, I applied the 2 patches and it works. Daniel ^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2008-02-08 9:51 UTC | newest] Thread overview: 11+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2008-01-28 19:00 ipcomp regression in 2.6.24 Beschorner Daniel 2008-01-29 8:07 ` Marco Berizzi 2008-01-30 3:15 ` Herbert Xu 2008-01-30 5:12 ` David Miller 2008-02-08 9:12 ` Marco Berizzi 2008-02-08 9:51 ` David Miller 2008-01-30 9:14 ` Marco Berizzi 2008-01-31 5:32 ` Herbert Xu 2008-01-31 5:48 ` David Miller 2008-01-31 8:37 ` Marco Berizzi 2008-01-31 12:00 ` Beschorner Daniel
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).