netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 0/7] sctp: support vrf processing
@ 2022-11-13 16:44 Xin Long
  2022-11-13 16:44 ` [PATCH net-next 1/7] sctp: verify the bind address with the tb_id from l3mdev Xin Long
                   ` (6 more replies)
  0 siblings, 7 replies; 16+ messages in thread
From: Xin Long @ 2022-11-13 16:44 UTC (permalink / raw)
  To: network dev, linux-sctp
  Cc: davem, kuba, Eric Dumazet, Paolo Abeni, Marcelo Ricardo Leitner,
	Neil Horman, David Ahern, Carlo Carraro

This patchset adds the VRF processing in SCTP. Simliar to TCP/UDP,
it includes socket bind and socket/association lookup changes.

For socket bind change, it allows sockets to bind to a VRF device
and allows multiple sockets with the same IP and PORT to bind to
different interfaces in patch 1-3.

For socket/association lookup change, it adds dif and sdif check
in both asoc and ep lookup in patch 4 and 5, and when binding to
nodev, users can decide if accept the packets received from one
l3mdev by setup a sysctl option in patch 6.

Note with VRF support, in a netns, an association will be decided
by src ip + src port + dst ip + dst port + bound_dev_if, and it's
possible for ss to have:

# ss --sctp -n
  State       Local Address:Port      Peer Address:Port
   ESTAB     192.168.1.2%vrf-s1:1234
   `- ESTAB   192.168.1.2%veth1:1234   192.168.1.1:1234
   ESTAB     192.168.1.2%vrf-s2:1234
   `- ESTAB   192.168.1.2%veth2:1234   192.168.1.1:1234

See the selftest in patch 7 for more usage.

Also, thanks Carlo for testing this patch series on their use.

Xin Long (7):
  sctp: verify the bind address with the tb_id from l3mdev
  sctp: check ipv6 addr with sk_bound_dev if set
  sctp: check sk_bound_dev_if when matching ep in get_port
  sctp: add skb_sdif in struct sctp_af
  sctp: add dif and sdif check in asoc and ep lookup
  sctp: add sysctl net.sctp.l3mdev_accept
  selftests: add a selftest for sctp vrf

 Documentation/networking/ip-sysctl.rst   |   9 ++
 include/net/netns/sctp.h                 |   4 +
 include/net/sctp/sctp.h                  |  16 ++-
 include/net/sctp/structs.h               |   9 +-
 net/sctp/diag.c                          |   3 +-
 net/sctp/endpointola.c                   |  13 +-
 net/sctp/input.c                         |  98 +++++++-------
 net/sctp/ipv6.c                          |  22 +++-
 net/sctp/protocol.c                      |  19 ++-
 net/sctp/socket.c                        |   9 +-
 net/sctp/sysctl.c                        |  11 ++
 tools/testing/selftests/net/Makefile     |   2 +
 tools/testing/selftests/net/sctp_hello.c | 139 ++++++++++++++++++++
 tools/testing/selftests/net/sctp_vrf.sh  | 160 +++++++++++++++++++++++
 14 files changed, 445 insertions(+), 69 deletions(-)
 create mode 100644 tools/testing/selftests/net/sctp_hello.c
 create mode 100755 tools/testing/selftests/net/sctp_vrf.sh

-- 
2.31.1


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2022-11-15 20:42 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-13 16:44 [PATCH net-next 0/7] sctp: support vrf processing Xin Long
2022-11-13 16:44 ` [PATCH net-next 1/7] sctp: verify the bind address with the tb_id from l3mdev Xin Long
2022-11-13 16:44 ` [PATCH net-next 2/7] sctp: check ipv6 addr with sk_bound_dev if set Xin Long
2022-11-13 16:44 ` [PATCH net-next 3/7] sctp: check sk_bound_dev_if when matching ep in get_port Xin Long
2022-11-13 16:44 ` [PATCH net-next 4/7] sctp: add skb_sdif in struct sctp_af Xin Long
2022-11-13 16:44 ` [PATCH net-next 5/7] sctp: add dif and sdif check in asoc and ep lookup Xin Long
2022-11-13 20:14   ` kernel test robot
2022-11-15  2:38     ` Xin Long
2022-11-15 10:19       ` Paolo Abeni
2022-11-15 15:25         ` Xin Long
2022-11-13 16:44 ` [PATCH net-next 6/7] sctp: add sysctl net.sctp.l3mdev_accept Xin Long
2022-11-13 16:44 ` [PATCH net-next 7/7] selftests: add a selftest for sctp vrf Xin Long
2022-11-15 10:29   ` Paolo Abeni
2022-11-15 15:33     ` Xin Long
2022-11-15 18:07       ` Xin Long
2022-11-15 20:40       ` Paolo Abeni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).