]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - include/net/inet_hashtables.h
sh: use kbuild.h instead of defining macros in asm-offsets.c
[linux-2.6-omap-h63xx.git] / include / net / inet_hashtables.h
index 48ac620cb8463db035dd93b36d82ea34d2ad05ec..735b926a3497a874eebbba280ab0b5769638ab7d 100644 (file)
@@ -221,26 +221,7 @@ static inline int inet_sk_listen_hashfn(const struct sock *sk)
 }
 
 /* Caller must disable local BH processing. */
-static inline void __inet_inherit_port(struct sock *sk, struct sock *child)
-{
-       struct inet_hashinfo *table = sk->sk_prot->hashinfo;
-       const int bhash = inet_bhashfn(inet_sk(child)->num, table->bhash_size);
-       struct inet_bind_hashbucket *head = &table->bhash[bhash];
-       struct inet_bind_bucket *tb;
-
-       spin_lock(&head->lock);
-       tb = inet_csk(sk)->icsk_bind_hash;
-       sk_add_bind_node(child, &tb->owners);
-       inet_csk(child)->icsk_bind_hash = tb;
-       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_inherit_port(struct sock *sk, struct sock *child);
 
 extern void inet_put_port(struct sock *sk);
 
@@ -314,25 +295,25 @@ typedef __u64 __bitwise __addrpair;
                                   ((__force __u64)(__be32)(__saddr)));
 #endif /* __BIG_ENDIAN */
 #define INET_MATCH(__sk, __net, __hash, __cookie, __saddr, __daddr, __ports, __dif)\
-       (((__sk)->sk_hash == (__hash)) && ((__sk)->sk_net == (__net))   &&      \
+       (((__sk)->sk_hash == (__hash)) && sock_net((__sk)) == (__net)   &&      \
         ((*((__addrpair *)&(inet_sk(__sk)->daddr))) == (__cookie))     &&      \
         ((*((__portpair *)&(inet_sk(__sk)->dport))) == (__ports))      &&      \
         (!((__sk)->sk_bound_dev_if) || ((__sk)->sk_bound_dev_if == (__dif))))
 #define INET_TW_MATCH(__sk, __net, __hash, __cookie, __saddr, __daddr, __ports, __dif)\
-       (((__sk)->sk_hash == (__hash)) && ((__sk)->sk_net == (__net))   &&      \
+       (((__sk)->sk_hash == (__hash)) && sock_net((__sk)) == (__net)   &&      \
         ((*((__addrpair *)&(inet_twsk(__sk)->tw_daddr))) == (__cookie)) &&     \
         ((*((__portpair *)&(inet_twsk(__sk)->tw_dport))) == (__ports)) &&      \
         (!((__sk)->sk_bound_dev_if) || ((__sk)->sk_bound_dev_if == (__dif))))
 #else /* 32-bit arch */
 #define INET_ADDR_COOKIE(__name, __saddr, __daddr)
 #define INET_MATCH(__sk, __net, __hash, __cookie, __saddr, __daddr, __ports, __dif)    \
-       (((__sk)->sk_hash == (__hash)) && ((__sk)->sk_net == (__net))   &&      \
+       (((__sk)->sk_hash == (__hash)) && sock_net((__sk)) == (__net)   &&      \
         (inet_sk(__sk)->daddr          == (__saddr))           &&      \
         (inet_sk(__sk)->rcv_saddr      == (__daddr))           &&      \
         ((*((__portpair *)&(inet_sk(__sk)->dport))) == (__ports))      &&      \
         (!((__sk)->sk_bound_dev_if) || ((__sk)->sk_bound_dev_if == (__dif))))
 #define INET_TW_MATCH(__sk, __net, __hash,__cookie, __saddr, __daddr, __ports, __dif)  \
-       (((__sk)->sk_hash == (__hash)) && ((__sk)->sk_net == (__net))   &&      \
+       (((__sk)->sk_hash == (__hash)) && sock_net((__sk)) == (__net)   &&      \
         (inet_twsk(__sk)->tw_daddr     == (__saddr))           &&      \
         (inet_twsk(__sk)->tw_rcv_saddr == (__daddr))           &&      \
         ((*((__portpair *)&(inet_twsk(__sk)->tw_dport))) == (__ports)) &&      \
@@ -389,7 +370,7 @@ static inline struct sock *inet_lookup(struct net *net,
 }
 
 extern int __inet_hash_connect(struct inet_timewait_death_row *death_row,
-               struct sock *sk,
+               struct sock *sk, u32 port_offset,
                int (*check_established)(struct inet_timewait_death_row *,
                        struct sock *, __u16, struct inet_timewait_sock **),
                               void (*hash)(struct sock *sk));