summaryrefslogtreecommitdiff
path: root/net/sctp/associola.c
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2012-08-06 08:41:13 +0000
committerDavid S. Miller <davem@davemloft.net>2012-08-14 22:44:12 -0700
commit4110cc255ddec59c79fba4d71cdd948d0a382140 (patch)
tree53fc9c7cd7e41f547d94469f9268fde2a5404616 /net/sctp/associola.c
parent4cdadcbcb64bdf3ae8bdf3ef5bb2b91c85444cfa (diff)
downloadkernel-common-4110cc255ddec59c79fba4d71cdd948d0a382140.tar.gz
kernel-common-4110cc255ddec59c79fba4d71cdd948d0a382140.tar.bz2
kernel-common-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 'net/sctp/associola.c')
-rw-r--r--net/sctp/associola.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/net/sctp/associola.c b/net/sctp/associola.c
index ebaef3ed6065..a3601f35ac15 100644
--- a/net/sctp/associola.c
+++ b/net/sctp/associola.c
@@ -1089,13 +1089,15 @@ out:
/* Is this the association we are looking for? */
struct sctp_transport *sctp_assoc_is_match(struct sctp_association *asoc,
+ struct net *net,
const union sctp_addr *laddr,
const union sctp_addr *paddr)
{
struct sctp_transport *transport;
if ((htons(asoc->base.bind_addr.port) == laddr->v4.sin_port) &&
- (htons(asoc->peer.port) == paddr->v4.sin_port)) {
+ (htons(asoc->peer.port) == paddr->v4.sin_port) &&
+ net_eq(sock_net(asoc->base.sk), net)) {
transport = sctp_assoc_lookup_paddr(asoc, paddr);
if (!transport)
goto out;