Skip to content

Commit c08e584

Browse files
lmcjomakuba-moo
authored andcommitted
tipc: fix wrong notification node addresses
The previous bug fix had an unfortunate side effect that broke distribution of binding table entries between nodes. The updated tipc_sock_addr struct is also used further down in the same function, and there the old value is still the correct one. Fixes: 032062f ("tipc: fix wrong publisher node address in link publications") Signed-off-by: Jon Maloy <jmaloy@redhat.com> Link: https://lore.kernel.org/r/20220216020009.3404578-1-jmaloy@redhat.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 8c6ae46 commit c08e584

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

net/tipc/node.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ static void tipc_node_write_unlock(struct tipc_node *n)
403403
u32 flags = n->action_flags;
404404
struct list_head *publ_list;
405405
struct tipc_uaddr ua;
406-
u32 bearer_id;
406+
u32 bearer_id, node;
407407

408408
if (likely(!flags)) {
409409
write_unlock_bh(&n->lock);
@@ -414,6 +414,7 @@ static void tipc_node_write_unlock(struct tipc_node *n)
414414
TIPC_LINK_STATE, n->addr, n->addr);
415415
sk.ref = n->link_id;
416416
sk.node = tipc_own_addr(net);
417+
node = n->addr;
417418
bearer_id = n->link_id & 0xffff;
418419
publ_list = &n->publ_list;
419420

@@ -423,17 +424,17 @@ static void tipc_node_write_unlock(struct tipc_node *n)
423424
write_unlock_bh(&n->lock);
424425

425426
if (flags & TIPC_NOTIFY_NODE_DOWN)
426-
tipc_publ_notify(net, publ_list, sk.node, n->capabilities);
427+
tipc_publ_notify(net, publ_list, node, n->capabilities);
427428

428429
if (flags & TIPC_NOTIFY_NODE_UP)
429-
tipc_named_node_up(net, sk.node, n->capabilities);
430+
tipc_named_node_up(net, node, n->capabilities);
430431

431432
if (flags & TIPC_NOTIFY_LINK_UP) {
432-
tipc_mon_peer_up(net, sk.node, bearer_id);
433+
tipc_mon_peer_up(net, node, bearer_id);
433434
tipc_nametbl_publish(net, &ua, &sk, sk.ref);
434435
}
435436
if (flags & TIPC_NOTIFY_LINK_DOWN) {
436-
tipc_mon_peer_down(net, sk.node, bearer_id);
437+
tipc_mon_peer_down(net, node, bearer_id);
437438
tipc_nametbl_withdraw(net, &ua, &sk, sk.ref);
438439
}
439440
}

0 commit comments

Comments
 (0)