[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+FuTSdCMqVqvUKfM3+3=B0k+2MQzB0+aNJJYQZP+d=k2dy34A@mail.gmail.com>
Date: Mon, 12 Jul 2021 09:59:04 +0200
From: Willem de Bruijn <willemdebruijn.kernel@...il.com>
To: Vadim Fedorenko <vfedorenko@...ek.ru>
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 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?
Powered by blists - more mailing lists