diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2012-08-06 08:41:13 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-08-14 22:44:12 -0700 |
commit | 4110cc255ddec59c79fba4d71cdd948d0a382140 (patch) | |
tree | 53fc9c7cd7e41f547d94469f9268fde2a5404616 /include/net/sctp/sctp.h | |
parent | 4cdadcbcb64bdf3ae8bdf3ef5bb2b91c85444cfa (diff) | |
download | linux-4110cc255ddec59c79fba4d71cdd948d0a382140.tar.gz linux-4110cc255ddec59c79fba4d71cdd948d0a382140.tar.bz2 linux-4110cc255ddec59c79fba4d71cdd948d0a382140.zip |
sctp: Make the association hashtable handle multiple network namespaces
- Use struct net in the hash calculation
- Use sock_net(association.base.sk) in the association lookups.
- On receive calculate the network namespace from skb->dev.
- Pass struct net from receive down to the functions that actually
do the association lookup.
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Acked-by: Vlad Yasevich <vyasevich@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/sctp/sctp.h')
-rw-r--r-- | include/net/sctp/sctp.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h index 87b119f74c4a..640915a0613d 100644 --- a/include/net/sctp/sctp.h +++ b/include/net/sctp/sctp.h @@ -156,7 +156,7 @@ void sctp_hash_established(struct sctp_association *); void sctp_unhash_established(struct sctp_association *); void sctp_hash_endpoint(struct sctp_endpoint *); void sctp_unhash_endpoint(struct sctp_endpoint *); -struct sock *sctp_err_lookup(int family, struct sk_buff *, +struct sock *sctp_err_lookup(struct net *net, int family, struct sk_buff *, struct sctphdr *, struct sctp_association **, struct sctp_transport **); void sctp_err_finish(struct sock *, struct sctp_association *); @@ -644,9 +644,9 @@ static inline int sctp_ep_hashfn(struct net *net, __u16 lport) } /* This is the hash function for the association hash table. */ -static inline int sctp_assoc_hashfn(__u16 lport, __u16 rport) +static inline int sctp_assoc_hashfn(struct net *net, __u16 lport, __u16 rport) { - int h = (lport << 16) + rport; + int h = (lport << 16) + rport + net_hash_mix(net); h ^= h>>8; return h & (sctp_assoc_hashsize - 1); } |