diff options
author | Pavel Emelyanov <xemul@openvz.org> | 2007-12-16 16:32:48 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 17:58:12 -0500 |
commit | 586f12115264b767ea6a48ce081ca25a39c1e3dd (patch) | |
tree | 48bb41f07d4dc2a1e0d9f9d71286594d3b9800fa /include | |
parent | 9355bbd685bf705a7f7bd6470b92ca0562c7a661 (diff) |
[IPV4]: Switch users of ipv4_devconf(_all) to use the pernet one
These are scattered over the code, but almost all the
"critical" places already have the proper struct net
at hand except for snmp proc showing function and routing
rtnl handler.
Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/inetdevice.h | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/include/linux/inetdevice.h b/include/linux/inetdevice.h index 962a062b44ff..b3c5081de02d 100644 --- a/include/linux/inetdevice.h +++ b/include/linux/inetdevice.h | |||
@@ -44,7 +44,8 @@ struct in_device | |||
44 | }; | 44 | }; |
45 | 45 | ||
46 | #define IPV4_DEVCONF(cnf, attr) ((cnf).data[NET_IPV4_CONF_ ## attr - 1]) | 46 | #define IPV4_DEVCONF(cnf, attr) ((cnf).data[NET_IPV4_CONF_ ## attr - 1]) |
47 | #define IPV4_DEVCONF_ALL(attr) IPV4_DEVCONF(ipv4_devconf, attr) | 47 | #define IPV4_DEVCONF_ALL(net, attr) \ |
48 | IPV4_DEVCONF((*(net)->ipv4.devconf_all), attr) | ||
48 | 49 | ||
49 | static inline int ipv4_devconf_get(struct in_device *in_dev, int index) | 50 | static inline int ipv4_devconf_get(struct in_device *in_dev, int index) |
50 | { | 51 | { |
@@ -71,11 +72,14 @@ static inline void ipv4_devconf_setall(struct in_device *in_dev) | |||
71 | ipv4_devconf_set((in_dev), NET_IPV4_CONF_ ## attr, (val)) | 72 | ipv4_devconf_set((in_dev), NET_IPV4_CONF_ ## attr, (val)) |
72 | 73 | ||
73 | #define IN_DEV_ANDCONF(in_dev, attr) \ | 74 | #define IN_DEV_ANDCONF(in_dev, attr) \ |
74 | (IPV4_DEVCONF_ALL(attr) && IN_DEV_CONF_GET((in_dev), attr)) | 75 | (IPV4_DEVCONF_ALL(in_dev->dev->nd_net, attr) && \ |
76 | IN_DEV_CONF_GET((in_dev), attr)) | ||
75 | #define IN_DEV_ORCONF(in_dev, attr) \ | 77 | #define IN_DEV_ORCONF(in_dev, attr) \ |
76 | (IPV4_DEVCONF_ALL(attr) || IN_DEV_CONF_GET((in_dev), attr)) | 78 | (IPV4_DEVCONF_ALL(in_dev->dev->nd_net, attr) || \ |
79 | IN_DEV_CONF_GET((in_dev), attr)) | ||
77 | #define IN_DEV_MAXCONF(in_dev, attr) \ | 80 | #define IN_DEV_MAXCONF(in_dev, attr) \ |
78 | (max(IPV4_DEVCONF_ALL(attr), IN_DEV_CONF_GET((in_dev), attr))) | 81 | (max(IPV4_DEVCONF_ALL(in_dev->dev->nd_net, attr), \ |
82 | IN_DEV_CONF_GET((in_dev), attr))) | ||
79 | 83 | ||
80 | #define IN_DEV_FORWARD(in_dev) IN_DEV_CONF_GET((in_dev), FORWARDING) | 84 | #define IN_DEV_FORWARD(in_dev) IN_DEV_CONF_GET((in_dev), FORWARDING) |
81 | #define IN_DEV_MFORWARD(in_dev) IN_DEV_ANDCONF((in_dev), MC_FORWARDING) | 85 | #define IN_DEV_MFORWARD(in_dev) IN_DEV_ANDCONF((in_dev), MC_FORWARDING) |