]> git.baikalelectronics.ru Git - kernel.git/commit
sctp: Make the port hash table use struct net in it's key.
authorEric W. Biederman <ebiederm@xmission.com>
Mon, 6 Aug 2012 08:39:38 +0000 (08:39 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 15 Aug 2012 05:44:12 +0000 (22:44 -0700)
commit9dd650b15cec3dc960120ad6676ae4efff584956
treeeb4a61a314b8a5176ff5f17ab803c5fd0c9579f5
parentdad26108fca23b765161f635caacde4029b06612
sctp: Make the port hash table use struct net in it's key.

- Add struct net into the port hash table hash calculation
- Add struct net inot the struct sctp_bind_bucket so there
  is a memory of which network namespace a port is allocated in.
  No need for a ref count because sctp_bind_bucket only exists
  when there are sockets in the hash table and sockets can not
  change their network namspace, and sockets already ref count
  their network namespace.
- Add struct net into the key comparison when we are testing
  to see if we have found the port hash table entry we are
  looking for.

With these changes lookups in the port hash table becomes
safe to use in multiple network namespaces.

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>
include/net/sctp/sctp.h
include/net/sctp/structs.h
net/sctp/socket.c