[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d8d7fa91-5ab4-3120-2e53-c8edee8ae528@cogentembedded.com>
Date: Thu, 8 Nov 2018 13:29:54 +0300
From: Sergei Shtylyov <sergei.shtylyov@...entembedded.com>
To: Paolo Abeni <pabeni@...hat.com>, netdev@...r.kernel.org
Cc: "David S. Miller" <davem@...emloft.net>,
Willem de Bruijn <willemb@...gle.com>,
Steffen Klassert <steffen.klassert@...unet.com>,
Subash Abhinov Kasiviswanathan <subashab@...eaurora.org>
Subject: Re: [PATCH net-next 05/10] ipv6: factor out protocol delivery helper
On 11/8/2018 1:13 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 <pabeni@...hat.com>
>>> ---
>>> 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).
Oops, my bad... I'm sorry. :-)
> Cheers,
>
> Paolo
MBR, Sergei
Powered by blists - more mailing lists