* [PATCH net-2.6.25] [ARP] Move inet_addr_type call after simple error checks in arp_contructor.
@ 2008-01-14 13:53 Denis V. Lunev
0 siblings, 0 replies; only message in thread
From: Denis V. Lunev @ 2008-01-14 13:53 UTC (permalink / raw)
To: davem; +Cc: netdev, devel, Denis V. Lunev
The neighbour entry will be destroyed in the case of error, so it is pointless
to perform constly routing table lookup in this case.
Signed-off-by: Denis V. Lunev <den@openvz.org>
---
net/ipv4/arp.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c
index b715ec0..49c24ff 100644
--- a/net/ipv4/arp.c
+++ b/net/ipv4/arp.c
@@ -235,8 +235,6 @@ static int arp_constructor(struct neighbour *neigh)
struct in_device *in_dev;
struct neigh_parms *parms;
- neigh->type = inet_addr_type(&init_net, addr);
-
rcu_read_lock();
in_dev = __in_dev_get_rcu(dev);
if (in_dev == NULL) {
@@ -244,6 +242,8 @@ static int arp_constructor(struct neighbour *neigh)
return -EINVAL;
}
+ neigh->type = inet_addr_type(&init_net, addr);
+
parms = in_dev->arp_parms;
__neigh_parms_put(neigh->parms);
neigh->parms = neigh_parms_clone(parms);
--
1.5.3.rc5
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2008-01-14 13:53 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-14 13:53 [PATCH net-2.6.25] [ARP] Move inet_addr_type call after simple error checks in arp_contructor Denis V. Lunev
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox