aboutsummaryrefslogtreecommitdiffstats
path: root/net/core
diff options
context:
space:
mode:
authorPavel Emelyanov <xemul@openvz.org>2007-10-15 15:54:15 -0400
committerDavid S. Miller <davem@davemloft.net>2007-10-15 15:54:15 -0400
commit4ae289444b968b4cefd776ada8da519ce10e56fa (patch)
tree06aa4ff04bb1acdb64c29fc4b28a5cf91b1d57b8 /net/core
parentf1673ca52c04f1b311abe03fd67cd4d650d19435 (diff)
[NEIGH]: Ensure that pneigh_lookup is protected with RTNL
The pnigh_lookup is used to lookup proxy entries and to create them in case lookup failed. However, the "creation" code does not perform the re-lookup after GFP_KERNEL allocation. This is done because the code is expected to be protected with the RTNL lock, so add the assertion (mainly to address future questions from new network developers like me :) ). Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
-rw-r--r--net/core/neighbour.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/net/core/neighbour.c b/net/core/neighbour.c
index c52df858d0be..cd3af59b38a1 100644
--- a/net/core/neighbour.c
+++ b/net/core/neighbour.c
@@ -481,6 +481,8 @@ struct pneigh_entry * pneigh_lookup(struct neigh_table *tbl, const void *pkey,
481 if (!creat) 481 if (!creat)
482 goto out; 482 goto out;
483 483
484 ASSERT_RTNL();
485
484 n = kmalloc(sizeof(*n) + key_len, GFP_KERNEL); 486 n = kmalloc(sizeof(*n) + key_len, GFP_KERNEL);
485 if (!n) 487 if (!n)
486 goto out; 488 goto out;