Skip to content

Commit

Permalink
[INET]: Drop the inet_inherit_port() call.
Browse files Browse the repository at this point in the history
As I can see from the code, two places (tcp_v6_syn_recv_sock and
dccp_v6_request_recv_sock) that call this one already run with
BHs disabled, so it's safe to call __inet_inherit_port there.

Besides (in case I missed smth with code review) the calltrace
tcp_v6_syn_recv_sock
 `- tcp_v4_syn_recv_sock
     `- __inet_inherit_port
and the similar for DCCP are valid, but assumes BHs to be disabled.

Signed-off-by: Pavel Emelyanov <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
xemul authored and davem330 committed Apr 18, 2008
1 parent 8b73a07 commit e56d8b8
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 9 deletions.
7 changes: 0 additions & 7 deletions include/net/inet_hashtables.h
Original file line number Diff line number Diff line change
Expand Up @@ -235,13 +235,6 @@ static inline void __inet_inherit_port(struct sock *sk, struct sock *child)
spin_unlock(&head->lock);
}

static inline void inet_inherit_port(struct sock *sk, struct sock *child)
{
local_bh_disable();
__inet_inherit_port(sk, child);
local_bh_enable();
}

extern void inet_put_port(struct sock *sk);

extern void inet_listen_wlock(struct inet_hashinfo *hashinfo);
Expand Down
2 changes: 1 addition & 1 deletion net/dccp/ipv6.c
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,7 @@ static struct sock *dccp_v6_request_recv_sock(struct sock *sk,
newinet->daddr = newinet->saddr = newinet->rcv_saddr = LOOPBACK4_IPV6;

__inet6_hash(newsk);
inet_inherit_port(sk, newsk);
__inet_inherit_port(sk, newsk);

return newsk;

Expand Down
2 changes: 1 addition & 1 deletion net/ipv6/tcp_ipv6.c
Original file line number Diff line number Diff line change
Expand Up @@ -1534,7 +1534,7 @@ static struct sock * tcp_v6_syn_recv_sock(struct sock *sk, struct sk_buff *skb,
#endif

__inet6_hash(newsk);
inet_inherit_port(sk, newsk);
__inet_inherit_port(sk, newsk);

return newsk;

Expand Down

0 comments on commit e56d8b8

Please sign in to comment.