diff options
author | Herbert Xu <herbert@gondor.apana.org.au> | 2007-06-05 02:36:06 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-06-07 16:39:26 -0400 |
commit | 71e27da9618b5f4d525ec821def83991da20429f (patch) | |
tree | 521645ee5c7e43cc0de100bc4425668e078d92f9 /net/ipv4/ipmr.c | |
parent | 31be308541e990592a2d0a3e77e8e51bd0cea0e0 (diff) |
[IPV4]: Restore old behaviour of default config values
Previously inet devices were only constructed when addresses are added
(or rarely in ipmr). Therefore the default config values they get are
the ones at the time of these operations.
Now that we're creating inet devices earlier, this changes the
behaviour of default config values in an incompatible way (see bug
#8519).
This patch creates a compromise by setting the default values at the
same point as before but only for those that have not been explicitly
set by the user since the inet device's creation.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/ipmr.c')
-rw-r--r-- | net/ipv4/ipmr.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c index d570d3ad40a9..d96582acdf69 100644 --- a/net/ipv4/ipmr.c +++ b/net/ipv4/ipmr.c | |||
@@ -152,9 +152,11 @@ struct net_device *ipmr_new_tunnel(struct vifctl *v) | |||
152 | dev->flags |= IFF_MULTICAST; | 152 | dev->flags |= IFF_MULTICAST; |
153 | 153 | ||
154 | in_dev = __in_dev_get_rtnl(dev); | 154 | in_dev = __in_dev_get_rtnl(dev); |
155 | if (in_dev == NULL && (in_dev = inetdev_init(dev)) == NULL) | 155 | if (in_dev == NULL) |
156 | goto failure; | 156 | goto failure; |
157 | IN_DEV_CONF_SET(in_dev, RP_FILTER, 0); | 157 | |
158 | ipv4_devconf_setall(in_dev); | ||
159 | IPV4_DEVCONF(in_dev->cnf, RP_FILTER) = 0; | ||
158 | 160 | ||
159 | if (dev_open(dev)) | 161 | if (dev_open(dev)) |
160 | goto failure; | 162 | goto failure; |
@@ -218,10 +220,15 @@ static struct net_device *ipmr_reg_vif(void) | |||
218 | } | 220 | } |
219 | dev->iflink = 0; | 221 | dev->iflink = 0; |
220 | 222 | ||
221 | if ((in_dev = inetdev_init(dev)) == NULL) | 223 | rcu_read_lock(); |
224 | if ((in_dev = __in_dev_get_rcu(dev)) == NULL) { | ||
225 | rcu_read_unlock(); | ||
222 | goto failure; | 226 | goto failure; |
227 | } | ||
223 | 228 | ||
224 | IN_DEV_CONF_SET(in_dev, RP_FILTER, 0); | 229 | ipv4_devconf_setall(in_dev); |
230 | IPV4_DEVCONF(in_dev->cnf, RP_FILTER) = 0; | ||
231 | rcu_read_unlock(); | ||
225 | 232 | ||
226 | if (dev_open(dev)) | 233 | if (dev_open(dev)) |
227 | goto failure; | 234 | goto failure; |