aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc/socket.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/tipc/socket.c')
-rw-r--r--net/tipc/socket.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/net/tipc/socket.c b/net/tipc/socket.c
index ee90d74d7516..f485600c4507 100644
--- a/net/tipc/socket.c
+++ b/net/tipc/socket.c
@@ -1764,13 +1764,14 @@ static int tipc_sk_enqueue(struct sk_buff_head *inputq, struct sock *sk,
1764int tipc_sk_rcv(struct net *net, struct sk_buff_head *inputq) 1764int tipc_sk_rcv(struct net *net, struct sk_buff_head *inputq)
1765{ 1765{
1766 u32 dnode, dport = 0; 1766 u32 dnode, dport = 0;
1767 int err = -TIPC_ERR_NO_PORT; 1767 int err;
1768 struct sk_buff *skb; 1768 struct sk_buff *skb;
1769 struct tipc_sock *tsk; 1769 struct tipc_sock *tsk;
1770 struct tipc_net *tn; 1770 struct tipc_net *tn;
1771 struct sock *sk; 1771 struct sock *sk;
1772 1772
1773 while (skb_queue_len(inputq)) { 1773 while (skb_queue_len(inputq)) {
1774 err = -TIPC_ERR_NO_PORT;
1774 skb = NULL; 1775 skb = NULL;
1775 dport = tipc_skb_peek_port(inputq, dport); 1776 dport = tipc_skb_peek_port(inputq, dport);
1776 tsk = tipc_sk_lookup(net, dport); 1777 tsk = tipc_sk_lookup(net, dport);
@@ -2141,11 +2142,17 @@ static void tipc_sk_timeout(unsigned long data)
2141 peer_node = tsk_peer_node(tsk); 2142 peer_node = tsk_peer_node(tsk);
2142 2143
2143 if (tsk->probing_state == TIPC_CONN_PROBING) { 2144 if (tsk->probing_state == TIPC_CONN_PROBING) {
2144 /* Previous probe not answered -> self abort */ 2145 if (!sock_owned_by_user(sk)) {
2145 skb = tipc_msg_create(TIPC_CRITICAL_IMPORTANCE, 2146 sk->sk_socket->state = SS_DISCONNECTING;
2146 TIPC_CONN_MSG, SHORT_H_SIZE, 0, 2147 tsk->connected = 0;
2147 own_node, peer_node, tsk->portid, 2148 tipc_node_remove_conn(sock_net(sk), tsk_peer_node(tsk),
2148 peer_port, TIPC_ERR_NO_PORT); 2149 tsk_peer_port(tsk));
2150 sk->sk_state_change(sk);
2151 } else {
2152 /* Try again later */
2153 sk_reset_timer(sk, &sk->sk_timer, (HZ / 20));
2154 }
2155
2149 } else { 2156 } else {
2150 skb = tipc_msg_create(CONN_MANAGER, CONN_PROBE, 2157 skb = tipc_msg_create(CONN_MANAGER, CONN_PROBE,
2151 INT_H_SIZE, 0, peer_node, own_node, 2158 INT_H_SIZE, 0, peer_node, own_node,