ipv6/udp: Add 4-tuple hash for connected socket
authorPhilo Lu <lulie@linux.alibaba.com>
Thu, 14 Nov 2024 10:52:07 +0000 (18:52 +0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 18 Nov 2024 11:56:21 +0000 (11:56 +0000)
commit1b29a730ef8b6fd3aa3e11c2f6d409cf201cd913
tree50b3a489273263957582fcbbd2ce04f513ffe405
parent78c91ae2c6deb5d236a5a93ff2995cdd05514380
ipv6/udp: Add 4-tuple hash for connected socket

Implement ipv6 udp hash4 like that in ipv4. The major difference is that
the hash value should be calculated with udp6_ehashfn(). Besides,
ipv4-mapped ipv6 address is handled before hash() and rehash(). Export
udp_ehashfn because now we use it in udpv6 rehash.

Core procedures of hash/unhash/rehash are same as ipv4, and udpv4 and
udpv6 share the same udptable, so some functions in ipv4 hash4 can also
be shared.

Co-developed-by: Cambda Zhu <cambda@linux.alibaba.com>
Signed-off-by: Cambda Zhu <cambda@linux.alibaba.com>
Co-developed-by: Fred Chen <fred.cc@alibaba-inc.com>
Signed-off-by: Fred Chen <fred.cc@alibaba-inc.com>
Co-developed-by: Yubing Qiu <yubing.qiuyubing@alibaba-inc.com>
Signed-off-by: Yubing Qiu <yubing.qiuyubing@alibaba-inc.com>
Signed-off-by: Philo Lu <lulie@linux.alibaba.com>
Acked-by: Willem de Bruijn <willemb@google.com>
Acked-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/udp.h
net/ipv4/udp.c
net/ipv6/udp.c