Hi,
today I was trying to setup one box as firewall providing also samba services
for internal network and I run into small problem that samba (and my test
programs) cannot listen only on internal interface...
Is there any real reason for quick path if (sk->num == hnum &&
sk->next == NULL)? This test skips SO_BINDTODEVICE and rcv_saddr check if
there is only one socket listning in this hashtable slot. It looks
suspicious to me. Is this path really so hot that this test must be there?
And if it must be there, is it possible to add
'&& !sk->rcv_saddr && !sk->bound_dev_if' into condition?
Thanks,
Petr Vandrovec
[EMAIL PROTECTED]
(net/ipv4/tcp_ipv4.c)
__inline__ struct sock *tcp_v4_lookup_listener(u32 daddr, unsigned short hnum, int dif)
{
struct sock *sk;
read_lock(&tcp_lhash_lock);
sk = tcp_listening_hash[tcp_lhashfn(hnum)];
if (sk) {
!!!! if (sk->num == hnum && sk->next == NULL)
!!!! goto sherry_cache;
sk = __tcp_v4_lookup_listener(sk, daddr, hnum, dif);
}
if (sk) {
sherry_cache:
sock_hold(sk);
}
read_unlock(&tcp_lhash_lock);
return sk;
}
-
To unsubscribe from this list: send the line "unsubscribe linux-net" in
the body of a message to [EMAIL PROTECTED]