Thread (18 messages) 18 messages, 4 authors, 2021-07-16

Re: [PATCH net 2/3] udp: check encap socket in __udp_lib_err

flat view

From: Vadim Fedorenko <hidden>
Date: 2021-07-12 12:09:11

On 12.07.2021 08:59, Willem de Bruijn wrote:
On Mon, Jul 12, 2021 at 2:56 AM Vadim Fedorenko [off-list ref] wrote:
quoted
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 <redacted>
---
  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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help