[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ad38c217-b97d-d4ad-7689-f2728a804fbf@novek.ru>
Date: Mon, 12 Jul 2021 13:09:03 +0100
From: Vadim Fedorenko <vfedorenko@...ek.ru>
To: Willem de Bruijn <willemdebruijn.kernel@...il.com>
Cc: David Ahern <dsahern@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
Xin Long <lucien.xin@...il.com>,
Jakub Kicinski <kuba@...nel.org>,
"David S. Miller" <davem@...emloft.net>, netdev@...r.kernel.org
Subject: Re: [PATCH net 2/3] udp: check encap socket in __udp_lib_err
On 12.07.2021 08:59, Willem de Bruijn wrote:
> On Mon, Jul 12, 2021 at 2:56 AM Vadim Fedorenko <vfedorenko@...ek.ru> wrote:
>>
>> Commit d26796ae5894 ("udp: check udp sock encap_type in __udp_lib_err")
>> added checks for encapsulated sockets but it broke cases when there is
>> no implementation of encap_err_lookup for encapsulation, i.e. ESP in
>> UDP encapsulation. Fix it by calling encap_err_lookup only if socket
>> implements this method otherwise treat it as legal socket.
>>
>> Fixes: d26796ae5894 ("udp: check udp sock encap_type in __udp_lib_err")
>> Signed-off-by: Vadim Fedorenko <vfedorenko@...ek.ru>
>> ---
>> net/ipv4/udp.c | 24 +++++++++++++++++++++++-
>> net/ipv6/udp.c | 22 ++++++++++++++++++++++
>> 2 files changed, 45 insertions(+), 1 deletion(-)
>
> This duplicates __udp4_lib_err_encap and __udp6_lib_err_encap.
>
> Can we avoid open-coding that logic multiple times?
>
Yes, sure. I was thinking about the same but wanted to get a feedback
on approach itself. I will try to implement parts of that duplicates
as helpers next round.
Powered by blists - more mailing lists