diff options
Diffstat (limited to 'net/ipv4/udp.c')
-rw-r--r-- | net/ipv4/udp.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index d5e75e976513..ffc837643a04 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c | |||
@@ -218,6 +218,7 @@ found: | |||
218 | sk->sk_hash = snum; | 218 | sk->sk_hash = snum; |
219 | if (sk_unhashed(sk)) { | 219 | if (sk_unhashed(sk)) { |
220 | sk_nulls_add_node_rcu(sk, &hslot->head); | 220 | sk_nulls_add_node_rcu(sk, &hslot->head); |
221 | hslot->count++; | ||
221 | sock_prot_inuse_add(sock_net(sk), sk->sk_prot, 1); | 222 | sock_prot_inuse_add(sock_net(sk), sk->sk_prot, 1); |
222 | } | 223 | } |
223 | error = 0; | 224 | error = 0; |
@@ -1053,6 +1054,7 @@ void udp_lib_unhash(struct sock *sk) | |||
1053 | 1054 | ||
1054 | spin_lock_bh(&hslot->lock); | 1055 | spin_lock_bh(&hslot->lock); |
1055 | if (sk_nulls_del_node_init_rcu(sk)) { | 1056 | if (sk_nulls_del_node_init_rcu(sk)) { |
1057 | hslot->count--; | ||
1056 | inet_sk(sk)->inet_num = 0; | 1058 | inet_sk(sk)->inet_num = 0; |
1057 | sock_prot_inuse_add(sock_net(sk), sk->sk_prot, -1); | 1059 | sock_prot_inuse_add(sock_net(sk), sk->sk_prot, -1); |
1058 | } | 1060 | } |
@@ -1862,6 +1864,7 @@ void __init udp_table_init(struct udp_table *table, const char *name) | |||
1862 | } | 1864 | } |
1863 | for (i = 0; i <= table->mask; i++) { | 1865 | for (i = 0; i <= table->mask; i++) { |
1864 | INIT_HLIST_NULLS_HEAD(&table->hash[i].head, i); | 1866 | INIT_HLIST_NULLS_HEAD(&table->hash[i].head, i); |
1867 | table->hash[i].count = 0; | ||
1865 | spin_lock_init(&table->hash[i].lock); | 1868 | spin_lock_init(&table->hash[i].lock); |
1866 | } | 1869 | } |
1867 | } | 1870 | } |