OSDN Git Service

tcp: Add l3index to tcp_md5sig_key and md5 functions
authorDavid Ahern <dsahern@gmail.com>
Mon, 30 Dec 2019 22:14:28 +0000 (14:14 -0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 2 Jan 2020 23:51:22 +0000 (15:51 -0800)
commitdea53bb80e07b9e1641b865493908c20cb8df2ac
tree83f171544bed6b95f3830a809854d7a235712fa0
parent534322ca3daf56a27c9712ae9b1fef4daede5516
tcp: Add l3index to tcp_md5sig_key and md5 functions

Add l3index to tcp_md5sig_key to represent the L3 domain of a key, and
add l3index to tcp_md5_do_add and tcp_md5_do_del to fill in the key.

With the key now based on an l3index, add the new parameter to the
lookup functions and consider the l3index when looking for a match.

The l3index comes from the skb when processing ingress packets leveraging
the helpers created for socket lookups, tcp_v4_sdif and inet_iif (and the
v6 variants). When the sdif index is set it means the packet ingressed a
device that is part of an L3 domain and inet_iif points to the VRF device.
For egress, the L3 domain is determined from the socket binding and
sk_bound_dev_if.

Signed-off-by: David Ahern <dsahern@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/tcp.h
net/ipv4/tcp_ipv4.c
net/ipv6/tcp_ipv6.c