On Tue, Mar 07, 2017 at 03:01:50PM +0800, Herbert Xu wrote: > On Mon, Mar 06, 2017 at 07:16:57AM +0100, Steffen Klassert wrote: > > > > > diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c > > > index b67719f..18383ef 100644 > > > --- a/net/ipv4/ip_output.c > > > +++ b/net/ipv4/ip_output.c > > > @@ -960,7 +960,10 @@ static int __ip_append_data(struct sock *sk, > > > cork->length += length; > > > if ((((length + fragheaderlen) > mtu) || (skb && skb_is_gso(skb))) && > > > (sk->sk_protocol == IPPROTO_UDP) && > > > - (rt->dst.dev->features & NETIF_F_UFO) && !rt->dst.header_len && > > > + (rt->dst.dev->features & NETIF_F_UFO) && > > > +#ifdef CONFIG_XFRM > > > + !rt->dst.xfrm && > > > +#endif > > > > Please fix IPcomp to use rt->dst.header_len instead off adding > > this ifdef to the generic networking code. > > It's not that simple though. IPComp's header_len is set to zero > because we opportunistically drop the IPComp header when the total > compressed length exceeds the original packet length. That is, > we only ever do IPComp when it does not cause the packet to expand.
Yes, indeed. And it makes sense of course. > > So it seems that we need another way of indicating the presence of > XFRM. Then we probably have to use the !rt->dst.xfrm check. But then we should use dst_xfrm() accessor, this avoids the ifdef here.