]> git.baikalelectronics.ru Git - kernel.git/commit
netlink: Move namespace into hash key
authorHerbert Xu <herbert@gondor.apana.org.au>
Fri, 20 Mar 2015 10:57:01 +0000 (21:57 +1100)
committerDavid S. Miller <davem@davemloft.net>
Fri, 20 Mar 2015 20:16:24 +0000 (16:16 -0400)
commiteea73e5d36f802c109c8f304d2c4a9291a377aea
treee742c46b87f015d694107e3a2b5b2d1bdb931499
parent4eae213dbb8f4574a13ed69bbb6a8d2aab6d9b33
netlink: Move namespace into hash key

Currently the name space is a de facto key because it has to match
before we find an object in the hash table.  However, it isn't in
the hash value so all objects from different name spaces with the
same port ID hash to the same bucket.

This is bad as the number of name spaces is unbounded.

This patch fixes this by using the namespace when doing the hash.

Because the namespace field doesn't lie next to the portid field
in the netlink socket, this patch switches over to the rhashtable
interface without a fixed key.

This patch also uses the new inlined rhashtable interface where
possible.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/netlink/af_netlink.c