]> git.baikalelectronics.ru Git - kernel.git/commit
udp: check udp sock encap_type in __udp_lib_err
authorXin Long <lucien.xin@gmail.com>
Thu, 29 Oct 2020 07:04:55 +0000 (15:04 +0800)
committerJakub Kicinski <kuba@kernel.org>
Fri, 30 Oct 2020 22:23:33 +0000 (15:23 -0700)
commit31bfe84d325aa1508030274c65468f07c029bd0f
tree4fc33ace0c7c3ffed5b09d70fa908d4c28adf921
parentad76ffab1aa416009b212b3b4ddc7a18c886ff6a
udp: check udp sock encap_type in __udp_lib_err

There is a chance that __udp4/6_lib_lookup() returns a udp encap
sock in __udp_lib_err(), like the udp encap listening sock may
use the same port as remote encap port, in which case it should
go to __udp4/6_lib_err_encap() for more validation before
processing the icmp packet.

This patch is to check encap_type in __udp_lib_err() for the
further validation for a encap sock.

Signed-off-by: Xin Long <lucien.xin@gmail.com>
Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/ipv4/udp.c
net/ipv6/udp.c