Skip to content

Commit 36d0a5f

Browse files
mctpd: update setup peer logic for bridged endpoints
For bridged endpoints, route setup is already done once pool space is allocated successfully. Those are destined to be routed from the bridge themselves without need of neighbours. Add appropiate check to avoid extra route creation for setting up bridged endpoints. Signed-off-by: Faizan Ali <[email protected]>
1 parent 5211a29 commit 36d0a5f

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/mctpd.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2856,13 +2856,18 @@ static int peer_route_update(struct peer *peer, uint16_t type)
28562856
static int setup_added_peer(struct peer *peer)
28572857
{
28582858
int rc;
2859+
struct net *n;
2860+
n = lookup_net(peer->ctx, peer->net);
28592861

28602862
// Set minimum MTU by default for compatibility. Clients can increase
28612863
// this with .SetMTU as needed
28622864
peer->mtu = mctp_nl_min_mtu_byindex(peer->ctx->nl, peer->phys.ifindex);
28632865

2864-
// add route before querying
2865-
add_peer_route(peer);
2866+
// add route before querying for non-bridged endpoints.
2867+
// bridged endpoints will be routed via gateway route from bridge itself
2868+
// without need of neighbour
2869+
if (!is_eid_in_bridge_pool(n, peer->ctx, peer->eid))
2870+
add_peer_route(peer);
28662871

28672872
rc = query_peer_properties(peer);
28682873
if (rc < 0)

0 commit comments

Comments
 (0)