inet: Fix __inet_inherit_port() to correctly increment bsockets and num_owners

inet sockets corresponding to passive connections are added to the bind hash
using ___inet_inherit_port(). These sockets are later removed from the bind
hash using __inet_put_port(). These two functions are not exactly symmetrical.
__inet_put_port() decrements hashinfo->bsockets and tb->num_owners, whereas
___inet_inherit_port() does not increment them. This results in both of these
going to -ve values.

This patch fixes this by calling inet_bind_hash() from ___inet_inherit_port(),
which does the right thing.

'bsockets' and 'num_owners' were introduced by commit a9d8f9110d7e953c
(inet: Allowing more than 64k connections and heavily optimize bind(0))

Signed-off-by: Nagendra Singh Tomar <tomer_iisc@yahoo.com>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Acked-by: Evgeniy Polyakov <zbr@ioremap.net>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by Nagendra Tomar and committed by David S. Miller b4ff3c90 5c7e57f7

+1 -2
+1 -2
net/ipv4/inet_hashtables.c
··· 133 133 } 134 134 } 135 135 } 136 - sk_add_bind_node(child, &tb->owners); 137 - inet_csk(child)->icsk_bind_hash = tb; 136 + inet_bind_hash(child, tb, port); 138 137 spin_unlock(&head->lock); 139 138 140 139 return 0;