From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Abeni Subject: Re: [PATCH net-next 05/10] ipv6: factor out protocol delivery helper Date: Thu, 08 Nov 2018 11:13:47 +0100 Message-ID: <0c668ae869c111bbfce9c9ba04e5c6ab2ce3c10a.camel@redhat.com> References: <12bde3e41997a124df10c1af678ace0af50e5d9e.1541588248.git.pabeni@redhat.com> <34872c3b-eba8-d7eb-22da-ee74b52b0610@cogentembedded.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Cc: "David S. Miller" , Willem de Bruijn , Steffen Klassert , Subash Abhinov Kasiviswanathan To: Sergei Shtylyov , netdev@vger.kernel.org Return-path: Received: from mx1.redhat.com ([209.132.183.28]:49778 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726405AbeKHTse (ORCPT ); Thu, 8 Nov 2018 14:48:34 -0500 In-Reply-To: <34872c3b-eba8-d7eb-22da-ee74b52b0610@cogentembedded.com> Sender: netdev-owner@vger.kernel.org List-ID: Hi, On Thu, 2018-11-08 at 12:01 +0300, Sergei Shtylyov wrote: > On 11/7/2018 2:38 PM, Paolo Abeni wrote: > > > So that we can re-use it at the UDP level in the next patch > > > > rfc v3 -> v1: > > - add the helper declaration into the ipv6 header > > > > Signed-off-by: Paolo Abeni > > --- > > include/net/ipv6.h | 2 ++ > > net/ipv6/ip6_input.c | 28 ++++++++++++++++------------ > > 2 files changed, 18 insertions(+), 12 deletions(-) > > > > diff --git a/include/net/ipv6.h b/include/net/ipv6.h > > index 829650540780..daf80863d3a5 100644 > > --- a/include/net/ipv6.h > > +++ b/include/net/ipv6.h > > [...] > > @@ -319,28 +319,26 @@ void ipv6_list_rcv(struct list_head *head, struct packet_type *pt, > > /* > > * Deliver the packet to the host > > */ > > - > > - > > -static int ip6_input_finish(struct net *net, struct sock *sk, struct sk_buff *skb) > > +void ip6_protocol_deliver_rcu(struct net *net, struct sk_buff *skb, int nexthdr, > > + bool have_final) > > { > > const struct inet6_protocol *ipprot; > > struct inet6_dev *idev; > > unsigned int nhoff; > > - int nexthdr; > > bool raw; > > - bool have_final = false; > > > > /* > > * Parse extension headers > > */ > > > > - rcu_read_lock(); > > resubmit: > > idev = ip6_dst_idev(skb_dst(skb)); > > - if (!pskb_pull(skb, skb_transport_offset(skb))) > > - goto discard; > > nhoff = IP6CB(skb)->nhoff; > > - nexthdr = skb_network_header(skb)[nhoff]; > > + if (!have_final) { > > Haven't you removed this variable above? > > > + if (!pskb_pull(skb, skb_transport_offset(skb))) > > + goto discard; > > + nexthdr = skb_network_header(skb)[nhoff]; > > And this? Thanks for reviewing. Both local variables are now function arguments (see the function signature, far above in this chunk). Cheers, Paolo