]> git.baikalelectronics.ru Git - kernel.git/commit
udp: check encap socket in __udp_lib_err
authorVadim Fedorenko <vfedorenko@novek.ru>
Tue, 20 Jul 2021 20:35:28 +0000 (23:35 +0300)
committerDavid S. Miller <davem@davemloft.net>
Wed, 21 Jul 2021 15:49:31 +0000 (08:49 -0700)
commit1c2c51e788603896f4cbf82a0dc3d018f0f75d3d
tree5590b051d5c00285ea9fd2ef4e2a976d47996124
parent52728af1daee645928a3f2d874acbd1c88714fde
udp: check encap socket in __udp_lib_err

Commit 31bfe84d325a ("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: 31bfe84d325a ("udp: check udp sock encap_type in __udp_lib_err")
Signed-off-by: Vadim Fedorenko <vfedorenko@novek.ru>
Reviewed-by: Xin Long <lucien.xin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/udp.c
net/ipv6/udp.c