diff options
Diffstat (limited to 'net/tipc/socket.c')
-rw-r--r-- | net/tipc/socket.c | 49 |
1 files changed, 26 insertions, 23 deletions
diff --git a/net/tipc/socket.c b/net/tipc/socket.c index 3a7567f690f3..87fef25f6519 100644 --- a/net/tipc/socket.c +++ b/net/tipc/socket.c | |||
@@ -686,21 +686,22 @@ new_mtu: | |||
686 | 686 | ||
687 | do { | 687 | do { |
688 | rc = tipc_bclink_xmit(net, pktchain); | 688 | rc = tipc_bclink_xmit(net, pktchain); |
689 | if (likely(rc >= 0)) { | 689 | if (likely(!rc)) |
690 | rc = dsz; | 690 | return dsz; |
691 | break; | 691 | |
692 | if (rc == -ELINKCONG) { | ||
693 | tsk->link_cong = 1; | ||
694 | rc = tipc_wait_for_sndmsg(sock, &timeo); | ||
695 | if (!rc) | ||
696 | continue; | ||
692 | } | 697 | } |
698 | __skb_queue_purge(pktchain); | ||
693 | if (rc == -EMSGSIZE) { | 699 | if (rc == -EMSGSIZE) { |
694 | msg->msg_iter = save; | 700 | msg->msg_iter = save; |
695 | goto new_mtu; | 701 | goto new_mtu; |
696 | } | 702 | } |
697 | if (rc != -ELINKCONG) | 703 | break; |
698 | break; | 704 | } while (1); |
699 | tipc_sk(sk)->link_cong = 1; | ||
700 | rc = tipc_wait_for_sndmsg(sock, &timeo); | ||
701 | if (rc) | ||
702 | __skb_queue_purge(pktchain); | ||
703 | } while (!rc); | ||
704 | return rc; | 705 | return rc; |
705 | } | 706 | } |
706 | 707 | ||
@@ -925,23 +926,24 @@ new_mtu: | |||
925 | skb = skb_peek(pktchain); | 926 | skb = skb_peek(pktchain); |
926 | TIPC_SKB_CB(skb)->wakeup_pending = tsk->link_cong; | 927 | TIPC_SKB_CB(skb)->wakeup_pending = tsk->link_cong; |
927 | rc = tipc_link_xmit(net, pktchain, dnode, tsk->portid); | 928 | rc = tipc_link_xmit(net, pktchain, dnode, tsk->portid); |
928 | if (likely(rc >= 0)) { | 929 | if (likely(!rc)) { |
929 | if (sock->state != SS_READY) | 930 | if (sock->state != SS_READY) |
930 | sock->state = SS_CONNECTING; | 931 | sock->state = SS_CONNECTING; |
931 | rc = dsz; | 932 | return dsz; |
932 | break; | ||
933 | } | 933 | } |
934 | if (rc == -ELINKCONG) { | ||
935 | tsk->link_cong = 1; | ||
936 | rc = tipc_wait_for_sndmsg(sock, &timeo); | ||
937 | if (!rc) | ||
938 | continue; | ||
939 | } | ||
940 | __skb_queue_purge(pktchain); | ||
934 | if (rc == -EMSGSIZE) { | 941 | if (rc == -EMSGSIZE) { |
935 | m->msg_iter = save; | 942 | m->msg_iter = save; |
936 | goto new_mtu; | 943 | goto new_mtu; |
937 | } | 944 | } |
938 | if (rc != -ELINKCONG) | 945 | break; |
939 | break; | 946 | } while (1); |
940 | tsk->link_cong = 1; | ||
941 | rc = tipc_wait_for_sndmsg(sock, &timeo); | ||
942 | if (rc) | ||
943 | __skb_queue_purge(pktchain); | ||
944 | } while (!rc); | ||
945 | 947 | ||
946 | return rc; | 948 | return rc; |
947 | } | 949 | } |
@@ -1048,10 +1050,11 @@ next: | |||
1048 | tsk->sent_unacked++; | 1050 | tsk->sent_unacked++; |
1049 | sent += send; | 1051 | sent += send; |
1050 | if (sent == dsz) | 1052 | if (sent == dsz) |
1051 | break; | 1053 | return dsz; |
1052 | goto next; | 1054 | goto next; |
1053 | } | 1055 | } |
1054 | if (rc == -EMSGSIZE) { | 1056 | if (rc == -EMSGSIZE) { |
1057 | __skb_queue_purge(pktchain); | ||
1055 | tsk->max_pkt = tipc_node_get_mtu(net, dnode, | 1058 | tsk->max_pkt = tipc_node_get_mtu(net, dnode, |
1056 | portid); | 1059 | portid); |
1057 | m->msg_iter = save; | 1060 | m->msg_iter = save; |
@@ -1059,13 +1062,13 @@ next: | |||
1059 | } | 1062 | } |
1060 | if (rc != -ELINKCONG) | 1063 | if (rc != -ELINKCONG) |
1061 | break; | 1064 | break; |
1065 | |||
1062 | tsk->link_cong = 1; | 1066 | tsk->link_cong = 1; |
1063 | } | 1067 | } |
1064 | rc = tipc_wait_for_sndpkt(sock, &timeo); | 1068 | rc = tipc_wait_for_sndpkt(sock, &timeo); |
1065 | if (rc) | ||
1066 | __skb_queue_purge(pktchain); | ||
1067 | } while (!rc); | 1069 | } while (!rc); |
1068 | 1070 | ||
1071 | __skb_queue_purge(pktchain); | ||
1069 | return sent ? sent : rc; | 1072 | return sent ? sent : rc; |
1070 | } | 1073 | } |
1071 | 1074 | ||