OSDN Git Service

mptcp: handle local addrs announced by userspace PMs
authorKishen Maloor <kishen.maloor@intel.com>
Wed, 4 May 2022 02:38:49 +0000 (19:38 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 4 May 2022 09:49:31 +0000 (10:49 +0100)
commit4638de5aefe56366726e5107a9da13ce5c84a1b7
treeb2b1d98baa25be0b299aeed76932598b2b9a9e0f
parentf43f0cd2d9b07caf38d744701b0b54d4244da8cc
mptcp: handle local addrs announced by userspace PMs

This change adds an internal function to store/retrieve local
addrs announced by userspace PM implementations to/from its kernel
context. The function addresses the requirements of three scenarios:
1) ADD_ADDR announcements (which require that a local id be
provided), 2) retrieving the local id associated with an address,
and also where one may need to be assigned, and 3) reissuance of
ADD_ADDRs when there's a successful match of addr/id.

The list of all stored local addr entries is held under the
MPTCP sock structure. Memory for these entries is allocated from
the sock option buffer, so the list of addrs is bounded by optmem_max.
The list if not released via REMOVE_ADDR signals is ultimately
freed when the sock is destructed.

Acked-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Kishen Maloor <kishen.maloor@intel.com>
Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/mptcp/Makefile
net/mptcp/pm.c
net/mptcp/pm_netlink.c
net/mptcp/pm_userspace.c [new file with mode: 0644]
net/mptcp/protocol.c
net/mptcp/protocol.h