diff options
author | Denis V. Lunev <den@openvz.org> | 2008-01-15 01:56:01 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 18:02:08 -0500 |
commit | a79878f00dad97d03a3e62a48b06227d55ae5fe4 (patch) | |
tree | 6d723e833f6e284da09580d8981d26a1ec32f587 /net/ipv4 | |
parent | a308da1627d711fd0c7542bfe892abc78d65d215 (diff) |
[ARP]: Move inet_addr_type call after simple error checks in arp_contructor.
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4')
-rw-r--r-- | 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 3f0730ec0a21..d12f31b0c107 100644 --- a/net/ipv4/arp.c +++ b/net/ipv4/arp.c | |||
@@ -235,8 +235,6 @@ static int arp_constructor(struct neighbour *neigh) | |||
235 | struct in_device *in_dev; | 235 | struct in_device *in_dev; |
236 | struct neigh_parms *parms; | 236 | struct neigh_parms *parms; |
237 | 237 | ||
238 | neigh->type = inet_addr_type(&init_net, addr); | ||
239 | |||
240 | rcu_read_lock(); | 238 | rcu_read_lock(); |
241 | in_dev = __in_dev_get_rcu(dev); | 239 | in_dev = __in_dev_get_rcu(dev); |
242 | if (in_dev == NULL) { | 240 | if (in_dev == NULL) { |
@@ -244,6 +242,8 @@ static int arp_constructor(struct neighbour *neigh) | |||
244 | return -EINVAL; | 242 | return -EINVAL; |
245 | } | 243 | } |
246 | 244 | ||
245 | neigh->type = inet_addr_type(&init_net, addr); | ||
246 | |||
247 | parms = in_dev->arp_parms; | 247 | parms = in_dev->arp_parms; |
248 | __neigh_parms_put(neigh->parms); | 248 | __neigh_parms_put(neigh->parms); |
249 | neigh->parms = neigh_parms_clone(parms); | 249 | neigh->parms = neigh_parms_clone(parms); |