net: mctp: Improved bind handling
Status from this message: This series was applied to netdev/net-next.git (main)
Get series with b4
b4 am [email protected] change-id 20250321-mctp-bind-e77968f180fdVersions newest first
- v4 Latest8 patches 3 repliesApplied 8/8
- v38 patches 4 repliesSuperseded
- v27 patches 0 repliesSuperseded
Earlier versions · 1
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v1 | 7 patches | 4 replies | Superseded |
Changes in v4 from the cover letter
- Fix error path socket release in mctp_bind()
- Fix commit message Fixes: for mctp_test_route_extaddr_input
- Link to v3: https://lore.kernel.org/r/[email protected]
Patches in v4 All 8 applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/8 | net: mctp: mctp_test_route_extaddr_input cleanupnet/ | +2 | 0 replies | Applied |
| 2/8 | net: mctp: Prevent duplicate bindsnet/ | +24 | 1 reply | Applied |
| 3/8 | net: mctp: Treat MCTP_NET_ANY specially in bind()net/ | +15 | 0 replies | Applied |
| 4/8 | net: mctp: Add test for conflicting bind()snet/ net/ net/ | +162 | 0 replies | Applied |
| 5/8 | net: mctp: Use hashtable for bindsinclude/ net/ net/ | +87 | 2 replies | Applied |
| 6/8 | net: mctp: Allow limiting binds to a peer addressinclude/ net/ net/ | +108 | 0 replies | Applied |
| 7/8 | net: mctp: Test conflicts of connect() with bind()net/ net/ net/ | +59 | 0 replies | Applied |
| 8/8 | net: mctp: Add bind lookup testnet/ net/ | +191 | 0 replies | Applied |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v4 yet.
Cover letter [PATCH net-next v4 0/8] net: mctp: Improved bind handling
This series improves a couple of aspects of MCTP bind() handling.
MCTP wasn't checking whether the same MCTP type was bound by multiple sockets. That would result in messages being received by an arbitrary socket, which isn't useful behaviour. Instead it makes more sense to have the duplicate binds fail, the same as other network protocols. An exception is made for more-specific binds to particular MCTP addresses.
It is also useful to be able to limit a bind to only receive incoming request messages (MCTP TO bit set) from a specific peer+type, so that individual processes can communicate with separate MCTP peers. One example is a PLDM firmware update requester, which will initiate communication with a device, and then the device will connect back to the requester process.
These limited binds are implemented by a connect() call on the socket prior to bind. connect() isn't used in the general case for MCTP, since a plain send() wouldn't provide the required MCTP tag argument for addressing.
---
Changes in v4:
- Fix error path socket release in mctp_bind()
- Fix commit message Fixes: for mctp_test_route_extaddr_input
- Link to v3: https://lore.kernel.org/r/[email protected]
Changes in v3:
- Rebased to net-next
- kunit tests have been updated for MCTP gateway routing changes
- Bind conflict tests are now in the new mctp/tests/sock-test.c
- Added patch for mctp_test_route_extaddr_input kunit socket cleanup
(fixes MCTP gateway routing change in net-next, required by tests in
this series)
- Link to v2: https://lore.kernel.org/r/[email protected]
Changes in v2:
- Use DECLARE_HASHTABLE
- Remove unused kunit test case
- Avoid kunit test snprintf truncation warning
- Fix lines >80 characters
- Link to v1: https://lore.kernel.org/r/[email protected]
---
Matt Johnston (8):
net: mctp: mctp_test_route_extaddr_input cleanup
net: mctp: Prevent duplicate binds
net: mctp: Treat MCTP_NET_ANY specially in bind()
net: mctp: Add test for conflicting bind()s
net: mctp: Use hashtable for binds
net: mctp: Allow limiting binds to a peer address
net: mctp: Test conflicts of connect() with bind()
net: mctp: Add bind lookup test
include/net/mctp.h | 5 +- include/net/netns/mctp.h | 20 ++++- net/mctp/af_mctp.c | 148 +++++++++++++++++++++++++++++++--- net/mctp/route.c | 85 ++++++++++++++++---- net/mctp/test/route-test.c | 194 ++++++++++++++++++++++++++++++++++++++++++++- net/mctp/test/sock-test.c | 167 ++++++++++++++++++++++++++++++++++++++ net/mctp/test/utils.c | 36 +++++++++ net/mctp/test/utils.h | 17 ++++ 8 files changed, 637 insertions(+), 35 deletions(-)
---
base-commit: ea988b450690448d5b12ce743a598ade7a8c34b1
change-id: 20250321-mctp-bind-e77968f180fd
Best regards,
Signature · 1 line
Matt Johnston <[email protected]>