From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Abeni Subject: Re: [RFC PATCH v3 06/10] udp: cope with UDP GRO packet misdirection Date: Fri, 02 Nov 2018 14:44:55 +0100 Message-ID: <6d64c6487ca692c08d09a139a5b5b880b378f051.camel@redhat.com> References: <0fbc6f0cea4b3a976a003a593c6365cb4e4a9e99.1540920083.git.pabeni@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Cc: Network Development , David Miller , Willem de Bruijn , steffen.klassert@secunet.com, Subash Abhinov Kasiviswanathan To: Willem de Bruijn Return-path: Received: from mx1.redhat.com ([209.132.183.28]:36214 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726794AbeKBWwJ (ORCPT ); Fri, 2 Nov 2018 18:52:09 -0400 In-Reply-To: Sender: netdev-owner@vger.kernel.org List-ID: On Thu, 2018-11-01 at 17:01 -0400, Willem de Bruijn wrote: > On Wed, Oct 31, 2018 at 5:57 AM Paolo Abeni wrote: > > @@ -450,4 +457,32 @@ DECLARE_STATIC_KEY_FALSE(udpv6_encap_needed_key); > > > void udpv6_encap_enable(void); > > > #endif > > > > > > +static inline struct sk_buff *udp_rcv_segment(struct sock *sk, > > > + struct sk_buff *skb) > > > +{ > > > + bool ipv4 = skb->protocol == htons(ETH_P_IP); > > > > And this cause a compile warning when # CONFIG_IPV6 is not set, I will > > fix in the next iteration (again thanks kbuildbot) > > Can also just pass it as argument. Agreed. > This skb->protocol should work correctly > with tunneled packets, but it wasn't as immediately obvious to me. > > Also > > + if (unlikely(!segs)) > + goto drop; > > this should not happen. But if it could and the caller treats it the > same as error (both now return NULL), then skb needs to be freed. Right you are. Will do in the next iteration. Thanks, Paolo