OSDN Git Service

net: Add device index to tcp_md5sig
authorDavid Ahern <dsahern@gmail.com>
Mon, 30 Dec 2019 22:14:29 +0000 (14:14 -0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 2 Jan 2020 23:51:22 +0000 (15:51 -0800)
commit6b102db50cdde3ba2f78631ed21222edf3a5fb51
tree81bd56771479c7ce34ce765f5e5fcaff74f00c36
parentdea53bb80e07b9e1641b865493908c20cb8df2ac
net: Add device index to tcp_md5sig

Add support for userspace to specify a device index to limit the scope
of an entry via the TCP_MD5SIG_EXT setsockopt. The existing __tcpm_pad
is renamed to tcpm_ifindex and the new field is only checked if the new
TCP_MD5SIG_FLAG_IFINDEX is set in tcpm_flags. For now, the device index
must point to an L3 master device (e.g., VRF). The API and error
handling are setup to allow the constraint to be relaxed in the future
to any device index.

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