diff options
Diffstat (limited to 'net/tipc/socket.c')
-rw-r--r-- | net/tipc/socket.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/net/tipc/socket.c b/net/tipc/socket.c index 701f31bbbbfb..e16197eb7b9f 100644 --- a/net/tipc/socket.c +++ b/net/tipc/socket.c | |||
@@ -47,7 +47,7 @@ | |||
47 | #define SS_READY -2 /* socket is connectionless */ | 47 | #define SS_READY -2 /* socket is connectionless */ |
48 | 48 | ||
49 | #define CONN_TIMEOUT_DEFAULT 8000 /* default connect timeout = 8s */ | 49 | #define CONN_TIMEOUT_DEFAULT 8000 /* default connect timeout = 8s */ |
50 | #define CONN_PROBING_INTERVAL 3600000 /* [ms] => 1 h */ | 50 | #define CONN_PROBING_INTERVAL msecs_to_jiffies(3600000) /* [ms] => 1 h */ |
51 | #define TIPC_FWD_MSG 1 | 51 | #define TIPC_FWD_MSG 1 |
52 | #define TIPC_CONN_OK 0 | 52 | #define TIPC_CONN_OK 0 |
53 | #define TIPC_CONN_PROBING 1 | 53 | #define TIPC_CONN_PROBING 1 |
@@ -68,7 +68,7 @@ | |||
68 | * @publications: list of publications for port | 68 | * @publications: list of publications for port |
69 | * @pub_count: total # of publications port has made during its lifetime | 69 | * @pub_count: total # of publications port has made during its lifetime |
70 | * @probing_state: | 70 | * @probing_state: |
71 | * @probing_interval: | 71 | * @probing_intv: |
72 | * @timer: | 72 | * @timer: |
73 | * @port: port - interacts with 'sk' and with the rest of the TIPC stack | 73 | * @port: port - interacts with 'sk' and with the rest of the TIPC stack |
74 | * @peer_name: the peer of the connection, if any | 74 | * @peer_name: the peer of the connection, if any |
@@ -93,7 +93,7 @@ struct tipc_sock { | |||
93 | struct list_head publications; | 93 | struct list_head publications; |
94 | u32 pub_count; | 94 | u32 pub_count; |
95 | u32 probing_state; | 95 | u32 probing_state; |
96 | u32 probing_interval; | 96 | unsigned long probing_intv; |
97 | struct timer_list timer; | 97 | struct timer_list timer; |
98 | uint conn_timeout; | 98 | uint conn_timeout; |
99 | atomic_t dupl_rcvcnt; | 99 | atomic_t dupl_rcvcnt; |
@@ -361,7 +361,7 @@ static int tipc_sk_create(struct net *net, struct socket *sock, | |||
361 | return -EINVAL; | 361 | return -EINVAL; |
362 | } | 362 | } |
363 | msg_set_origport(msg, tsk->portid); | 363 | msg_set_origport(msg, tsk->portid); |
364 | k_init_timer(&tsk->timer, (Handler)tipc_sk_timeout, tsk->portid); | 364 | setup_timer(&tsk->timer, tipc_sk_timeout, tsk->portid); |
365 | sk->sk_backlog_rcv = tipc_backlog_rcv; | 365 | sk->sk_backlog_rcv = tipc_backlog_rcv; |
366 | sk->sk_rcvbuf = sysctl_tipc_rmem[1]; | 366 | sk->sk_rcvbuf = sysctl_tipc_rmem[1]; |
367 | sk->sk_data_ready = tipc_data_ready; | 367 | sk->sk_data_ready = tipc_data_ready; |
@@ -511,7 +511,7 @@ static int tipc_release(struct socket *sock) | |||
511 | } | 511 | } |
512 | 512 | ||
513 | tipc_sk_withdraw(tsk, 0, NULL); | 513 | tipc_sk_withdraw(tsk, 0, NULL); |
514 | k_cancel_timer(&tsk->timer); | 514 | del_timer_sync(&tsk->timer); |
515 | tipc_sk_remove(tsk); | 515 | tipc_sk_remove(tsk); |
516 | if (tsk->connected) { | 516 | if (tsk->connected) { |
517 | skb = tipc_msg_create(TIPC_CRITICAL_IMPORTANCE, TIPC_CONN_MSG, | 517 | skb = tipc_msg_create(TIPC_CRITICAL_IMPORTANCE, TIPC_CONN_MSG, |
@@ -522,7 +522,6 @@ static int tipc_release(struct socket *sock) | |||
522 | tipc_link_xmit_skb(skb, dnode, tsk->portid); | 522 | tipc_link_xmit_skb(skb, dnode, tsk->portid); |
523 | tipc_node_remove_conn(dnode, tsk->portid); | 523 | tipc_node_remove_conn(dnode, tsk->portid); |
524 | } | 524 | } |
525 | k_term_timer(&tsk->timer); | ||
526 | 525 | ||
527 | /* Discard any remaining (connection-based) messages in receive queue */ | 526 | /* Discard any remaining (connection-based) messages in receive queue */ |
528 | __skb_queue_purge(&sk->sk_receive_queue); | 527 | __skb_queue_purge(&sk->sk_receive_queue); |
@@ -1139,10 +1138,10 @@ static void tipc_sk_finish_conn(struct tipc_sock *tsk, u32 peer_port, | |||
1139 | msg_set_lookup_scope(msg, 0); | 1138 | msg_set_lookup_scope(msg, 0); |
1140 | msg_set_hdr_sz(msg, SHORT_H_SIZE); | 1139 | msg_set_hdr_sz(msg, SHORT_H_SIZE); |
1141 | 1140 | ||
1142 | tsk->probing_interval = CONN_PROBING_INTERVAL; | 1141 | tsk->probing_intv = CONN_PROBING_INTERVAL; |
1143 | tsk->probing_state = TIPC_CONN_OK; | 1142 | tsk->probing_state = TIPC_CONN_OK; |
1144 | tsk->connected = 1; | 1143 | tsk->connected = 1; |
1145 | k_start_timer(&tsk->timer, tsk->probing_interval); | 1144 | mod_timer(&tsk->timer, jiffies + tsk->probing_intv); |
1146 | tipc_node_add_conn(peer_node, tsk->portid, peer_port); | 1145 | tipc_node_add_conn(peer_node, tsk->portid, peer_port); |
1147 | tsk->max_pkt = tipc_node_get_mtu(peer_node, tsk->portid); | 1146 | tsk->max_pkt = tipc_node_get_mtu(peer_node, tsk->portid); |
1148 | } | 1147 | } |
@@ -2128,7 +2127,7 @@ static void tipc_sk_timeout(unsigned long portid) | |||
2128 | 0, peer_node, tipc_own_addr, | 2127 | 0, peer_node, tipc_own_addr, |
2129 | peer_port, portid, TIPC_OK); | 2128 | peer_port, portid, TIPC_OK); |
2130 | tsk->probing_state = TIPC_CONN_PROBING; | 2129 | tsk->probing_state = TIPC_CONN_PROBING; |
2131 | k_start_timer(&tsk->timer, tsk->probing_interval); | 2130 | mod_timer(&tsk->timer, jiffies + tsk->probing_intv); |
2132 | } | 2131 | } |
2133 | bh_unlock_sock(sk); | 2132 | bh_unlock_sock(sk); |
2134 | if (skb) | 2133 | if (skb) |