Netdev Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
To: Vadim Fedorenko <vfedorenko@novek.ru>
Cc: David Ahern <dsahern@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Xin Long <lucien.xin@gmail.com>, Jakub Kicinski <kuba@kernel.org>,
	"David S. Miller" <davem@davemloft.net>,
	netdev@vger.kernel.org
Subject: Re: [PATCH net 2/3] udp: check encap socket in __udp_lib_err
Date: Mon, 12 Jul 2021 09:59:04 +0200	[thread overview]
Message-ID: <CA+FuTSdCMqVqvUKfM3+3=B0k+2MQzB0+aNJJYQZP+d=k2dy34A@mail.gmail.com> (raw)
In-Reply-To: <20210712005554.26948-3-vfedorenko@novek.ru>

On Mon, Jul 12, 2021 at 2:56 AM Vadim Fedorenko <vfedorenko@novek.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@novek.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?

  reply	other threads:[~2021-07-12  8:05 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-12  0:55 [PATCH net 0/3] Fix PMTU for ESP-in-UDP encapsulation Vadim Fedorenko
2021-07-12  0:55 ` [PATCH net 1/3] udp: check for encap using encap_enable Vadim Fedorenko
2021-07-12  8:37   ` Paolo Abeni
2021-07-12 12:32     ` Vadim Fedorenko
2021-07-12 14:05       ` Paolo Abeni
2021-07-12 14:13         ` Vadim Fedorenko
2021-07-12 14:33           ` Paolo Abeni
2021-07-12 16:27             ` Vadim Fedorenko
2021-07-12  0:55 ` [PATCH net 2/3] udp: check encap socket in __udp_lib_err Vadim Fedorenko
2021-07-12  7:59   ` Willem de Bruijn [this message]
2021-07-12 12:09     ` Vadim Fedorenko
2021-07-12  9:07   ` Paolo Abeni
2021-07-12 12:45     ` Vadim Fedorenko
2021-07-12 13:37       ` Paolo Abeni
2021-07-12 14:05         ` Vadim Fedorenko
2021-07-12 14:09           ` Paolo Abeni
2021-07-16 17:50         ` Xin Long
2021-07-12  0:55 ` [PATCH net 3/3] selftests: net: add ESP-in-UDP PMTU test Vadim Fedorenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CA+FuTSdCMqVqvUKfM3+3=B0k+2MQzB0+aNJJYQZP+d=k2dy34A@mail.gmail.com' \
    --to=willemdebruijn.kernel@gmail.com \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=kuba@kernel.org \
    --cc=lucien.xin@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=vfedorenko@novek.ru \
    --subject='Re: [PATCH net 2/3] udp: check encap socket in __udp_lib_err' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).