Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e56d8b8a authored by Pavel Emelyanov's avatar Pavel Emelyanov Committed by David S. Miller
Browse files

[INET]: Drop the inet_inherit_port() call.



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: default avatarPavel Emelyanov <xemul@openvz.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 8b73a07c
Loading
Loading
Loading
Loading
+0 −7
Original line number Original line Diff line number Diff line
@@ -235,13 +235,6 @@ static inline void __inet_inherit_port(struct sock *sk, struct sock *child)
	spin_unlock(&head->lock);
	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_put_port(struct sock *sk);


extern void inet_listen_wlock(struct inet_hashinfo *hashinfo);
extern void inet_listen_wlock(struct inet_hashinfo *hashinfo);
+1 −1
Original line number Original line Diff line number Diff line
@@ -625,7 +625,7 @@ static struct sock *dccp_v6_request_recv_sock(struct sock *sk,
	newinet->daddr = newinet->saddr = newinet->rcv_saddr = LOOPBACK4_IPV6;
	newinet->daddr = newinet->saddr = newinet->rcv_saddr = LOOPBACK4_IPV6;


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


	return newsk;
	return newsk;


+1 −1
Original line number Original line Diff line number Diff line
@@ -1534,7 +1534,7 @@ static struct sock * tcp_v6_syn_recv_sock(struct sock *sk, struct sk_buff *skb,
#endif
#endif


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


	return newsk;
	return newsk;