summaryrefslogtreecommitdiff
path: root/net/sctp/endpointola.c
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2012-08-06 12:41:13 +0400
committerDavid S. Miller <davem@davemloft.net>2012-08-15 09:44:12 +0400
commit4110cc255ddec59c79fba4d71cdd948d0a382140 (patch)
tree53fc9c7cd7e41f547d94469f9268fde2a5404616 /net/sctp/endpointola.c
parent4cdadcbcb64bdf3ae8bdf3ef5bb2b91c85444cfa (diff)
downloadlinux-4110cc255ddec59c79fba4d71cdd948d0a382140.tar.xz
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 'net/sctp/endpointola.c')
-rw-r--r--net/sctp/endpointola.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/net/sctp/endpointola.c b/net/sctp/endpointola.c
index 50c87b4ad765..6b763939345b 100644
--- a/net/sctp/endpointola.c
+++ b/net/sctp/endpointola.c
@@ -345,7 +345,8 @@ static struct sctp_association *__sctp_endpoint_lookup_assoc(
rport = ntohs(paddr->v4.sin_port);
- hash = sctp_assoc_hashfn(ep->base.bind_addr.port, rport);
+ hash = sctp_assoc_hashfn(sock_net(ep->base.sk), ep->base.bind_addr.port,
+ rport);
head = &sctp_assoc_hashtable[hash];
read_lock(&head->lock);
sctp_for_each_hentry(epb, node, &head->chain) {
@@ -388,13 +389,14 @@ int sctp_endpoint_is_peeled_off(struct sctp_endpoint *ep,
{
struct sctp_sockaddr_entry *addr;
struct sctp_bind_addr *bp;
+ struct net *net = sock_net(ep->base.sk);
bp = &ep->base.bind_addr;
/* This function is called with the socket lock held,
* so the address_list can not change.
*/
list_for_each_entry(addr, &bp->address_list, list) {
- if (sctp_has_association(&addr->a, paddr))
+ if (sctp_has_association(net, &addr->a, paddr))
return 1;
}