diff options
Diffstat (limited to 'net/tipc/bcast.c')
-rw-r--r-- | net/tipc/bcast.c | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/net/tipc/bcast.c b/net/tipc/bcast.c index 4a1a3c8627d0..7b238b1f339b 100644 --- a/net/tipc/bcast.c +++ b/net/tipc/bcast.c | |||
@@ -352,6 +352,8 @@ void tipc_bclink_update_link_state(struct tipc_node *n_ptr, u32 last_sent) | |||
352 | buf = tipc_buf_acquire(INT_H_SIZE); | 352 | buf = tipc_buf_acquire(INT_H_SIZE); |
353 | if (buf) { | 353 | if (buf) { |
354 | struct tipc_msg *msg = buf_msg(buf); | 354 | struct tipc_msg *msg = buf_msg(buf); |
355 | struct sk_buff *skb = skb_peek(&n_ptr->bclink.deferred_queue); | ||
356 | u32 to = skb ? buf_seqno(skb) - 1 : n_ptr->bclink.last_sent; | ||
355 | 357 | ||
356 | tipc_msg_init(msg, BCAST_PROTOCOL, STATE_MSG, | 358 | tipc_msg_init(msg, BCAST_PROTOCOL, STATE_MSG, |
357 | INT_H_SIZE, n_ptr->addr); | 359 | INT_H_SIZE, n_ptr->addr); |
@@ -359,9 +361,7 @@ void tipc_bclink_update_link_state(struct tipc_node *n_ptr, u32 last_sent) | |||
359 | msg_set_mc_netid(msg, tipc_net_id); | 361 | msg_set_mc_netid(msg, tipc_net_id); |
360 | msg_set_bcast_ack(msg, n_ptr->bclink.last_in); | 362 | msg_set_bcast_ack(msg, n_ptr->bclink.last_in); |
361 | msg_set_bcgap_after(msg, n_ptr->bclink.last_in); | 363 | msg_set_bcgap_after(msg, n_ptr->bclink.last_in); |
362 | msg_set_bcgap_to(msg, n_ptr->bclink.deferred_head | 364 | msg_set_bcgap_to(msg, to); |
363 | ? buf_seqno(n_ptr->bclink.deferred_head) - 1 | ||
364 | : n_ptr->bclink.last_sent); | ||
365 | 365 | ||
366 | tipc_bclink_lock(); | 366 | tipc_bclink_lock(); |
367 | tipc_bearer_send(MAX_BEARERS, buf, NULL); | 367 | tipc_bearer_send(MAX_BEARERS, buf, NULL); |
@@ -574,31 +574,26 @@ receive: | |||
574 | if (node->bclink.last_in == node->bclink.last_sent) | 574 | if (node->bclink.last_in == node->bclink.last_sent) |
575 | goto unlock; | 575 | goto unlock; |
576 | 576 | ||
577 | if (!node->bclink.deferred_head) { | 577 | if (skb_queue_empty(&node->bclink.deferred_queue)) { |
578 | node->bclink.oos_state = 1; | 578 | node->bclink.oos_state = 1; |
579 | goto unlock; | 579 | goto unlock; |
580 | } | 580 | } |
581 | 581 | ||
582 | msg = buf_msg(node->bclink.deferred_head); | 582 | msg = buf_msg(skb_peek(&node->bclink.deferred_queue)); |
583 | seqno = msg_seqno(msg); | 583 | seqno = msg_seqno(msg); |
584 | next_in = mod(next_in + 1); | 584 | next_in = mod(next_in + 1); |
585 | if (seqno != next_in) | 585 | if (seqno != next_in) |
586 | goto unlock; | 586 | goto unlock; |
587 | 587 | ||
588 | /* Take in-sequence message from deferred queue & deliver it */ | 588 | /* Take in-sequence message from deferred queue & deliver it */ |
589 | buf = node->bclink.deferred_head; | 589 | buf = __skb_dequeue(&node->bclink.deferred_queue); |
590 | node->bclink.deferred_head = buf->next; | ||
591 | buf->next = NULL; | ||
592 | node->bclink.deferred_size--; | ||
593 | goto receive; | 590 | goto receive; |
594 | } | 591 | } |
595 | 592 | ||
596 | /* Handle out-of-sequence broadcast message */ | 593 | /* Handle out-of-sequence broadcast message */ |
597 | if (less(next_in, seqno)) { | 594 | if (less(next_in, seqno)) { |
598 | deferred = tipc_link_defer_pkt(&node->bclink.deferred_head, | 595 | deferred = tipc_link_defer_pkt(&node->bclink.deferred_queue, |
599 | &node->bclink.deferred_tail, | ||
600 | buf); | 596 | buf); |
601 | node->bclink.deferred_size += deferred; | ||
602 | bclink_update_last_sent(node, seqno); | 597 | bclink_update_last_sent(node, seqno); |
603 | buf = NULL; | 598 | buf = NULL; |
604 | } | 599 | } |
@@ -954,6 +949,7 @@ int tipc_bclink_init(void) | |||
954 | 949 | ||
955 | spin_lock_init(&bclink->lock); | 950 | spin_lock_init(&bclink->lock); |
956 | __skb_queue_head_init(&bcl->outqueue); | 951 | __skb_queue_head_init(&bcl->outqueue); |
952 | __skb_queue_head_init(&bcl->deferred_queue); | ||
957 | __skb_queue_head_init(&bcl->waiting_sks); | 953 | __skb_queue_head_init(&bcl->waiting_sks); |
958 | bcl->next_out_no = 1; | 954 | bcl->next_out_no = 1; |
959 | spin_lock_init(&bclink->node.lock); | 955 | spin_lock_init(&bclink->node.lock); |