Skip to content

net: Support STP on bridge in non-root netns.

Kuniyuki Iwashima netdev 2 versions – Applied

Status from this message: This series was applied to netdev/net.git (main)

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest4 patches 0 repliesApplied 4/4
  2. v14 patches 3 repliesSuperseded

Changes in v2 from the cover letter

* Patch 1 : Update changelog, s/in the following patch/soon/
* Patch 1 & 2 : Fix kdoc warning of make W=1

Patches in v2 All 4 applied

#Subject and filesSizeRepliesApplied
1/4llc: Check netns in llc_dgram_match().net/llc/llc_sap.c+11 -70 repliesApplied
2/4llc: Check netns in llc_estab_match() and llc_listener_match().include/net/llc_conn.h net/llc/af_llc.c net/llc/llc_conn.c +1 more+33 -220 repliesApplied
3/4llc: Don't drop packet from non-root netns.net/llc/llc_input.c+0 -30 repliesApplied
4/4Revert "bridge: Add extack warning when enabling STP in netns."net/bridge/br_stp_if.c+0 -30 repliesApplied

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 net 0/4] net: Support STP on bridge in non-root netns.

Currently, STP does not work in non-root netns as llc_rcv() drops packets from non-root netns.

This series fixes it by making some protocol handlers netns-aware, which are called from llc_rcv() as follows:

llc_rcv()

  |
  |- sap->rcv_func : registered by llc_sap_open()
  |
  |  * functions : regsitered by register_8022_client()
  |    -> No in-kernel user call register_8022_client()
  |
  |  * snap_rcv()
  |    |
  |    `- proto->rcvfunc() : registered by register_snap_client()
  |
  |       * aarp_rcv()  : drop packets from non-root netns
  |       * atalk_rcv() : drop packets from non-root netns
  |
  |  * stp_pdu_rcv()
  |    |
  |    `- garp_protos[]->rcv() : registered by stp_proto_register()
  |
  |       * garp_pdu_rcv() : netns-aware
  |       * br_stp_rcv()   : netns-aware
  |
  |- llc_type_handlers[llc_pdu_type(skb) - 1]
  |
  |  * llc_sap_handler()  : NOT netns-aware (Patch 1)
  |  * llc_conn_handler() : NOT netns-aware (Patch 2)
  |

`- llc_station_handler

* llc_station_rcv() : netns-aware

Patch 1 & 2 convert not-netns-aware functions and Patch 3 remove the netns restriction in llc_rcv().

Note this series does not namespacify AF_LLC so that these patches can be backported to stable without conflicts (at least to 4.14.y).

Another series that adds netns support for AF_LLC will be targeted to net-next later.

Changes:
v2:
* Patch 1 : Update changelog, s/in the following patch/soon/
* Patch 1 & 2 : Fix kdoc warning of make W=1

v1: https://lore.kernel.org/netdev/[email protected]/

Kuniyuki Iwashima (4):
llc: Check netns in llc_dgram_match().
llc: Check netns in llc_estab_match() and llc_listener_match().
llc: Don't drop packet from non-root netns.
Revert "bridge: Add extack warning when enabling STP in netns."

 include/net/llc_conn.h |  2 +-
 net/bridge/br_stp_if.c |  3 ---
 net/llc/af_llc.c       |  2 +-
 net/llc/llc_conn.c     | 49 ++++++++++++++++++++++++++----------------
 net/llc/llc_if.c       |  2 +-
 net/llc/llc_input.c    |  3 ---
 net/llc/llc_sap.c      | 18 ++++++++++------
 7 files changed, 44 insertions(+), 35 deletions(-)
Signature · 1 line
2.30.2