mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-26 16:41:25 +00:00
[IPV4]: Convert IPv4 devconf to an array
This patch converts the ipv4_devconf config members (everything except sysctl) to an array. This allows easier manipulation which will be needed later on to provide better management of default config values. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
8d76527e72
commit
42f811b8bc
9 changed files with 162 additions and 259 deletions
|
@ -877,7 +877,7 @@ static int arp_process(struct sk_buff *skb)
|
|||
|
||||
n = __neigh_lookup(&arp_tbl, &sip, dev, 0);
|
||||
|
||||
if (ipv4_devconf.arp_accept) {
|
||||
if (IPV4_DEVCONF_ALL(ARP_ACCEPT)) {
|
||||
/* Unsolicited ARP is not accepted by default.
|
||||
It is possible, that this option should be enabled for some
|
||||
devices (strip is candidate)
|
||||
|
@ -987,11 +987,11 @@ static int arp_req_set(struct arpreq *r, struct net_device * dev)
|
|||
return 0;
|
||||
}
|
||||
if (dev == NULL) {
|
||||
ipv4_devconf.proxy_arp = 1;
|
||||
IPV4_DEVCONF_ALL(PROXY_ARP) = 1;
|
||||
return 0;
|
||||
}
|
||||
if (__in_dev_get_rtnl(dev)) {
|
||||
__in_dev_get_rtnl(dev)->cnf.proxy_arp = 1;
|
||||
IN_DEV_CONF_SET(__in_dev_get_rtnl(dev), PROXY_ARP, 1);
|
||||
return 0;
|
||||
}
|
||||
return -ENXIO;
|
||||
|
@ -1093,11 +1093,12 @@ static int arp_req_delete(struct arpreq *r, struct net_device * dev)
|
|||
return pneigh_delete(&arp_tbl, &ip, dev);
|
||||
if (mask == 0) {
|
||||
if (dev == NULL) {
|
||||
ipv4_devconf.proxy_arp = 0;
|
||||
IPV4_DEVCONF_ALL(PROXY_ARP) = 0;
|
||||
return 0;
|
||||
}
|
||||
if (__in_dev_get_rtnl(dev)) {
|
||||
__in_dev_get_rtnl(dev)->cnf.proxy_arp = 0;
|
||||
IN_DEV_CONF_SET(__in_dev_get_rtnl(dev),
|
||||
PROXY_ARP, 0);
|
||||
return 0;
|
||||
}
|
||||
return -ENXIO;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue