diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2012-08-06 04:40:21 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-08-15 01:44:12 -0400 |
commit | 4cdadcbcb64bdf3ae8bdf3ef5bb2b91c85444cfa (patch) | |
tree | fc6fd317dd6e128f176101c5843f58ed8ab86c9c /net/sctp/endpointola.c | |
parent | f1f4376307ca45558eb22487022aefceed7385e8 (diff) |
sctp: Make the endpoint hashtable handle multiple network namespaces
- Use struct net in the hash calculation
- Use sock_net(endpoint.base.sk) in the endpoint lookups.
- On receive calculate the network namespace from skb->dev.
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.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/net/sctp/endpointola.c b/net/sctp/endpointola.c index 68a385d7c3bd..50c87b4ad765 100644 --- a/net/sctp/endpointola.c +++ b/net/sctp/endpointola.c | |||
@@ -302,11 +302,13 @@ void sctp_endpoint_put(struct sctp_endpoint *ep) | |||
302 | 302 | ||
303 | /* Is this the endpoint we are looking for? */ | 303 | /* Is this the endpoint we are looking for? */ |
304 | struct sctp_endpoint *sctp_endpoint_is_match(struct sctp_endpoint *ep, | 304 | struct sctp_endpoint *sctp_endpoint_is_match(struct sctp_endpoint *ep, |
305 | struct net *net, | ||
305 | const union sctp_addr *laddr) | 306 | const union sctp_addr *laddr) |
306 | { | 307 | { |
307 | struct sctp_endpoint *retval = NULL; | 308 | struct sctp_endpoint *retval = NULL; |
308 | 309 | ||
309 | if (htons(ep->base.bind_addr.port) == laddr->v4.sin_port) { | 310 | if ((htons(ep->base.bind_addr.port) == laddr->v4.sin_port) && |
311 | net_eq(sock_net(ep->base.sk), net)) { | ||
310 | if (sctp_bind_addr_match(&ep->base.bind_addr, laddr, | 312 | if (sctp_bind_addr_match(&ep->base.bind_addr, laddr, |
311 | sctp_sk(ep->base.sk))) | 313 | sctp_sk(ep->base.sk))) |
312 | retval = ep; | 314 | retval = ep; |