diff options
Diffstat (limited to 'include/linux/inetdevice.h')
-rw-r--r-- | include/linux/inetdevice.h | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/include/linux/inetdevice.h b/include/linux/inetdevice.h index d83fee2dc643..fc4e3db649e8 100644 --- a/include/linux/inetdevice.h +++ b/include/linux/inetdevice.h | |||
@@ -17,8 +17,6 @@ struct ipv4_devconf | |||
17 | DECLARE_BITMAP(state, __NET_IPV4_CONF_MAX - 1); | 17 | DECLARE_BITMAP(state, __NET_IPV4_CONF_MAX - 1); |
18 | }; | 18 | }; |
19 | 19 | ||
20 | extern struct ipv4_devconf ipv4_devconf; | ||
21 | |||
22 | struct in_device | 20 | struct in_device |
23 | { | 21 | { |
24 | struct net_device *dev; | 22 | struct net_device *dev; |
@@ -44,7 +42,8 @@ struct in_device | |||
44 | }; | 42 | }; |
45 | 43 | ||
46 | #define IPV4_DEVCONF(cnf, attr) ((cnf).data[NET_IPV4_CONF_ ## attr - 1]) | 44 | #define IPV4_DEVCONF(cnf, attr) ((cnf).data[NET_IPV4_CONF_ ## attr - 1]) |
47 | #define IPV4_DEVCONF_ALL(attr) IPV4_DEVCONF(ipv4_devconf, attr) | 45 | #define IPV4_DEVCONF_ALL(net, attr) \ |
46 | IPV4_DEVCONF((*(net)->ipv4.devconf_all), attr) | ||
48 | 47 | ||
49 | static inline int ipv4_devconf_get(struct in_device *in_dev, int index) | 48 | static inline int ipv4_devconf_get(struct in_device *in_dev, int index) |
50 | { | 49 | { |
@@ -71,16 +70,17 @@ static inline void ipv4_devconf_setall(struct in_device *in_dev) | |||
71 | ipv4_devconf_set((in_dev), NET_IPV4_CONF_ ## attr, (val)) | 70 | ipv4_devconf_set((in_dev), NET_IPV4_CONF_ ## attr, (val)) |
72 | 71 | ||
73 | #define IN_DEV_ANDCONF(in_dev, attr) \ | 72 | #define IN_DEV_ANDCONF(in_dev, attr) \ |
74 | (IPV4_DEVCONF_ALL(attr) && IN_DEV_CONF_GET((in_dev), attr)) | 73 | (IPV4_DEVCONF_ALL(in_dev->dev->nd_net, attr) && \ |
74 | IN_DEV_CONF_GET((in_dev), attr)) | ||
75 | #define IN_DEV_ORCONF(in_dev, attr) \ | 75 | #define IN_DEV_ORCONF(in_dev, attr) \ |
76 | (IPV4_DEVCONF_ALL(attr) || IN_DEV_CONF_GET((in_dev), attr)) | 76 | (IPV4_DEVCONF_ALL(in_dev->dev->nd_net, attr) || \ |
77 | IN_DEV_CONF_GET((in_dev), attr)) | ||
77 | #define IN_DEV_MAXCONF(in_dev, attr) \ | 78 | #define IN_DEV_MAXCONF(in_dev, attr) \ |
78 | (max(IPV4_DEVCONF_ALL(attr), IN_DEV_CONF_GET((in_dev), attr))) | 79 | (max(IPV4_DEVCONF_ALL(in_dev->dev->nd_net, attr), \ |
80 | IN_DEV_CONF_GET((in_dev), attr))) | ||
79 | 81 | ||
80 | #define IN_DEV_FORWARD(in_dev) IN_DEV_CONF_GET((in_dev), FORWARDING) | 82 | #define IN_DEV_FORWARD(in_dev) IN_DEV_CONF_GET((in_dev), FORWARDING) |
81 | #define IN_DEV_MFORWARD(in_dev) (IPV4_DEVCONF_ALL(MC_FORWARDING) && \ | 83 | #define IN_DEV_MFORWARD(in_dev) IN_DEV_ANDCONF((in_dev), MC_FORWARDING) |
82 | IPV4_DEVCONF((in_dev)->cnf, \ | ||
83 | MC_FORWARDING)) | ||
84 | #define IN_DEV_RPFILTER(in_dev) IN_DEV_ANDCONF((in_dev), RP_FILTER) | 84 | #define IN_DEV_RPFILTER(in_dev) IN_DEV_ANDCONF((in_dev), RP_FILTER) |
85 | #define IN_DEV_SOURCE_ROUTE(in_dev) IN_DEV_ANDCONF((in_dev), \ | 85 | #define IN_DEV_SOURCE_ROUTE(in_dev) IN_DEV_ANDCONF((in_dev), \ |
86 | ACCEPT_SOURCE_ROUTE) | 86 | ACCEPT_SOURCE_ROUTE) |
@@ -127,15 +127,14 @@ struct in_ifaddr | |||
127 | extern int register_inetaddr_notifier(struct notifier_block *nb); | 127 | extern int register_inetaddr_notifier(struct notifier_block *nb); |
128 | extern int unregister_inetaddr_notifier(struct notifier_block *nb); | 128 | extern int unregister_inetaddr_notifier(struct notifier_block *nb); |
129 | 129 | ||
130 | extern struct net_device *ip_dev_find(__be32 addr); | 130 | extern struct net_device *ip_dev_find(struct net *net, __be32 addr); |
131 | extern int inet_addr_onlink(struct in_device *in_dev, __be32 a, __be32 b); | 131 | extern int inet_addr_onlink(struct in_device *in_dev, __be32 a, __be32 b); |
132 | extern int devinet_ioctl(unsigned int cmd, void __user *); | 132 | extern int devinet_ioctl(unsigned int cmd, void __user *); |
133 | extern void devinet_init(void); | 133 | extern void devinet_init(void); |
134 | extern struct in_device *inetdev_by_index(int); | 134 | extern struct in_device *inetdev_by_index(struct net *, int); |
135 | extern __be32 inet_select_addr(const struct net_device *dev, __be32 dst, int scope); | 135 | extern __be32 inet_select_addr(const struct net_device *dev, __be32 dst, int scope); |
136 | extern __be32 inet_confirm_addr(const struct net_device *dev, __be32 dst, __be32 local, int scope); | 136 | extern __be32 inet_confirm_addr(struct in_device *in_dev, __be32 dst, __be32 local, int scope); |
137 | extern struct in_ifaddr *inet_ifa_byprefix(struct in_device *in_dev, __be32 prefix, __be32 mask); | 137 | extern struct in_ifaddr *inet_ifa_byprefix(struct in_device *in_dev, __be32 prefix, __be32 mask); |
138 | extern void inet_forward_change(void); | ||
139 | 138 | ||
140 | static __inline__ int inet_ifa_match(__be32 addr, struct in_ifaddr *ifa) | 139 | static __inline__ int inet_ifa_match(__be32 addr, struct in_ifaddr *ifa) |
141 | { | 140 | { |