diff options
author | Pavel Emelyanov <xemul@openvz.org> | 2007-12-05 21:20:18 -0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 14:56:38 -0800 |
commit | 46479b432989d61c6f676adf21b4f4d8abd7bc26 (patch) | |
tree | 5e81203d7085c75274ed1948fc091ddd7de17ce4 /net/ipv4/arp.c | |
parent | 43dc1701172b7f73c495dea6c165c73ab8934f76 (diff) | |
download | linux-46479b432989d61c6f676adf21b4f4d8abd7bc26.tar.bz2 |
[ARP]: Minus one level of ndentation in arp_req_delete
The same cleanup for deletion requests.
Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/arp.c')
-rw-r--r-- | net/ipv4/arp.c | 47 |
1 files changed, 27 insertions, 20 deletions
diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c index 04e0ecdd07be..e947ad9409b0 100644 --- a/net/ipv4/arp.c +++ b/net/ipv4/arp.c @@ -1074,32 +1074,39 @@ static int arp_req_get(struct arpreq *r, struct net_device *dev) return err; } +static int arp_req_delete_public(struct arpreq *r, struct net_device *dev) +{ + __be32 ip = ((struct sockaddr_in *) &r->arp_pa)->sin_addr.s_addr; + __be32 mask = ((struct sockaddr_in *)&r->arp_netmask)->sin_addr.s_addr; + + if (mask == htonl(0xFFFFFFFF)) + return pneigh_delete(&arp_tbl, &ip, dev); + + if (mask == 0) { + if (dev == NULL) { + IPV4_DEVCONF_ALL(PROXY_ARP) = 0; + return 0; + } + if (__in_dev_get_rtnl(dev)) { + IN_DEV_CONF_SET(__in_dev_get_rtnl(dev), + PROXY_ARP, 0); + return 0; + } + return -ENXIO; + } + return -EINVAL; +} + static int arp_req_delete(struct arpreq *r, struct net_device * dev) { int err; - __be32 ip = ((struct sockaddr_in *)&r->arp_pa)->sin_addr.s_addr; + __be32 ip; struct neighbour *neigh; - if (r->arp_flags & ATF_PUBL) { - __be32 mask = - ((struct sockaddr_in *)&r->arp_netmask)->sin_addr.s_addr; - if (mask == htonl(0xFFFFFFFF)) - return pneigh_delete(&arp_tbl, &ip, dev); - if (mask == 0) { - if (dev == NULL) { - IPV4_DEVCONF_ALL(PROXY_ARP) = 0; - return 0; - } - if (__in_dev_get_rtnl(dev)) { - IN_DEV_CONF_SET(__in_dev_get_rtnl(dev), - PROXY_ARP, 0); - return 0; - } - return -ENXIO; - } - return -EINVAL; - } + if (r->arp_flags & ATF_PUBL) + return arp_req_delete_public(r, dev); + ip = ((struct sockaddr_in *)&r->arp_pa)->sin_addr.s_addr; if (dev == NULL) { struct flowi fl = { .nl_u = { .ip4_u = { .daddr = ip, .tos = RTO_ONLINK } } }; |