diff options
Diffstat (limited to 'net/tipc/node.c')
-rw-r--r-- | net/tipc/node.c | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/net/tipc/node.c b/net/tipc/node.c index 7e8b75fd1a02..7ef14e2d2356 100644 --- a/net/tipc/node.c +++ b/net/tipc/node.c | |||
@@ -1262,6 +1262,34 @@ void tipc_node_broadcast(struct net *net, struct sk_buff *skb) | |||
1262 | kfree_skb(skb); | 1262 | kfree_skb(skb); |
1263 | } | 1263 | } |
1264 | 1264 | ||
1265 | static void tipc_node_bc_sync_rcv(struct tipc_node *n, struct tipc_msg *hdr, | ||
1266 | int bearer_id, struct sk_buff_head *xmitq) | ||
1267 | { | ||
1268 | struct tipc_link *ucl; | ||
1269 | int rc; | ||
1270 | |||
1271 | rc = tipc_bcast_sync_rcv(n->net, n->bc_entry.link, hdr); | ||
1272 | |||
1273 | if (rc & TIPC_LINK_DOWN_EVT) { | ||
1274 | tipc_bearer_reset_all(n->net); | ||
1275 | return; | ||
1276 | } | ||
1277 | |||
1278 | if (!(rc & TIPC_LINK_SND_STATE)) | ||
1279 | return; | ||
1280 | |||
1281 | /* If probe message, a STATE response will be sent anyway */ | ||
1282 | if (msg_probe(hdr)) | ||
1283 | return; | ||
1284 | |||
1285 | /* Produce a STATE message carrying broadcast NACK */ | ||
1286 | tipc_node_read_lock(n); | ||
1287 | ucl = n->links[bearer_id].link; | ||
1288 | if (ucl) | ||
1289 | tipc_link_build_state_msg(ucl, xmitq); | ||
1290 | tipc_node_read_unlock(n); | ||
1291 | } | ||
1292 | |||
1265 | /** | 1293 | /** |
1266 | * tipc_node_bc_rcv - process TIPC broadcast packet arriving from off-node | 1294 | * tipc_node_bc_rcv - process TIPC broadcast packet arriving from off-node |
1267 | * @net: the applicable net namespace | 1295 | * @net: the applicable net namespace |
@@ -1298,7 +1326,7 @@ static void tipc_node_bc_rcv(struct net *net, struct sk_buff *skb, int bearer_id | |||
1298 | rc = tipc_bcast_rcv(net, be->link, skb); | 1326 | rc = tipc_bcast_rcv(net, be->link, skb); |
1299 | 1327 | ||
1300 | /* Broadcast ACKs are sent on a unicast link */ | 1328 | /* Broadcast ACKs are sent on a unicast link */ |
1301 | if (rc & TIPC_LINK_SND_BC_ACK) { | 1329 | if (rc & TIPC_LINK_SND_STATE) { |
1302 | tipc_node_read_lock(n); | 1330 | tipc_node_read_lock(n); |
1303 | tipc_link_build_state_msg(le->link, &xmitq); | 1331 | tipc_link_build_state_msg(le->link, &xmitq); |
1304 | tipc_node_read_unlock(n); | 1332 | tipc_node_read_unlock(n); |
@@ -1505,7 +1533,7 @@ void tipc_rcv(struct net *net, struct sk_buff *skb, struct tipc_bearer *b) | |||
1505 | 1533 | ||
1506 | /* Ensure broadcast reception is in synch with peer's send state */ | 1534 | /* Ensure broadcast reception is in synch with peer's send state */ |
1507 | if (unlikely(usr == LINK_PROTOCOL)) | 1535 | if (unlikely(usr == LINK_PROTOCOL)) |
1508 | tipc_bcast_sync_rcv(net, n->bc_entry.link, hdr); | 1536 | tipc_node_bc_sync_rcv(n, hdr, bearer_id, &xmitq); |
1509 | else if (unlikely(tipc_link_acked(n->bc_entry.link) != bc_ack)) | 1537 | else if (unlikely(tipc_link_acked(n->bc_entry.link) != bc_ack)) |
1510 | tipc_bcast_ack_rcv(net, n->bc_entry.link, bc_ack); | 1538 | tipc_bcast_ack_rcv(net, n->bc_entry.link, bc_ack); |
1511 | 1539 | ||