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
307 n_ptr->bclink.acked = tipc_bclink_get_last_sent();307 n_ptr->bclink.acked = tipc_bclink_get_last_sent();
308 308
309 if (n_ptr->bclink.supported) {309 if (n_ptr->bclink.supported) {
310 tipc_nmap_add(&tipc_bcast_nmap, n_ptr->addr);310 tipc_bclink_add_node(n_ptr->addr);
311 if (n_ptr->addr < tipc_own_addr)311 if (n_ptr->addr < tipc_own_addr)
312 tipc_own_tag++;312 tipc_own_tag++;
313 }313 }
@@ -350,7 +350,7 @@ static void node_lost_contact(struct tipc_node *n_ptr) · 36 unmodified lines
350 n_ptr->bclink.defragm = NULL;350 n_ptr->bclink.defragm = NULL;
351 }351 }
352 352
353 tipc_nmap_remove(&tipc_bcast_nmap, n_ptr->addr);353 tipc_bclink_remove_node(n_ptr->addr);
354 tipc_bclink_acknowledge(n_ptr,354 tipc_bclink_acknowledge(n_ptr,
355 mod(n_ptr->bclink.acked + 10000));355 mod(n_ptr->bclink.acked + 10000));
356 if (n_ptr->addr < tipc_own_addr)356 if (n_ptr->addr < tipc_own_addr)