]> 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)
commitf8976f97fc54be7c45c901ca39421ac3a0318a26
tree5590b051d5c00285ea9fd2ef4e2a976d47996124
parent77116f40757fbac85e8dfb35b8b4bd478cc76e96
udp: check encap socket in __udp_lib_err

Commit c6bdb45ea928 ("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: c6bdb45ea928 ("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