On Mon, Jul 12, 2021 at 2:56 AM Vadim Fedorenko [off-list ref] 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 <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?