History

tipc: Ensure broadcast link spinlock is held when updating node map

Fixes oversight that allowed broadcast link node map to be updated without first taking the broadcast link spinlock that protects the map. As part of this fix the node map has been incorporated into the broadcast link structure to make the need for such protection more evident.

Allan Stephens committed 15 years ago

Commit cd3decd1 parent c47e9b93 files · +22 −10Browse files

Showing the changes to net/tipc/node.c (1 of 3 files). Show all

Unified · Split

net/tipc/node.c+2−2
@@ -307,7 +307,7 @@ static void node_established_contact(struct tipc_node *n_ptr) · 306 unmodified lines
307307 n_ptr->bclink.acked = tipc_bclink_get_last_sent();
308308
309309 if (n_ptr->bclink.supported) {
310− tipc_nmap_add(&tipc_bcast_nmap, n_ptr->addr);
310+ tipc_bclink_add_node(n_ptr->addr);
311311 if (n_ptr->addr < tipc_own_addr)
312312 tipc_own_tag++;
313313 }
@@ -350,7 +350,7 @@ static void node_lost_contact(struct tipc_node *n_ptr) · 36 unmodified lines
350350 n_ptr->bclink.defragm = NULL;
351351 }
352352
353− tipc_nmap_remove(&tipc_bcast_nmap, n_ptr->addr);
353+ tipc_bclink_remove_node(n_ptr->addr);
354354 tipc_bclink_acknowledge(n_ptr,
355355 mod(n_ptr->bclink.acked + 10000));
356356 if (n_ptr->addr < tipc_own_addr)