diff options
author | Oliver Hartkopp <socketcan@hartkopp.net> | 2007-05-23 17:35:31 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-05-24 19:36:44 -0400 |
commit | bbb711e63332d7b43b535381c78b26a66cd60f48 (patch) | |
tree | bda65cfb57c6665953f485a1e6cb7d552bfee4d7 /net | |
parent | 36247f5421015eab0bdd96789b24790598934db9 (diff) |
[IPV6]: Ignore ipv6 events on non-IPV6 capable devices.
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
Signed-off-by: Urs Thuermann <urs@isnogud.escape.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/ipv6/addrconf.c | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index c7ea248fae2e..329de679ac38 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c | |||
@@ -2154,15 +2154,6 @@ static void addrconf_dev_config(struct net_device *dev) | |||
2154 | 2154 | ||
2155 | ASSERT_RTNL(); | 2155 | ASSERT_RTNL(); |
2156 | 2156 | ||
2157 | if ((dev->type != ARPHRD_ETHER) && | ||
2158 | (dev->type != ARPHRD_FDDI) && | ||
2159 | (dev->type != ARPHRD_IEEE802_TR) && | ||
2160 | (dev->type != ARPHRD_ARCNET) && | ||
2161 | (dev->type != ARPHRD_INFINIBAND)) { | ||
2162 | /* Alas, we support only Ethernet autoconfiguration. */ | ||
2163 | return; | ||
2164 | } | ||
2165 | |||
2166 | idev = addrconf_add_dev(dev); | 2157 | idev = addrconf_add_dev(dev); |
2167 | if (idev == NULL) | 2158 | if (idev == NULL) |
2168 | return; | 2159 | return; |
@@ -2250,13 +2241,33 @@ static void addrconf_ip6_tnl_config(struct net_device *dev) | |||
2250 | ip6_tnl_add_linklocal(idev); | 2241 | ip6_tnl_add_linklocal(idev); |
2251 | } | 2242 | } |
2252 | 2243 | ||
2244 | static int ipv6_hwtype(struct net_device *dev) | ||
2245 | { | ||
2246 | if ((dev->type == ARPHRD_ETHER) || | ||
2247 | (dev->type == ARPHRD_LOOPBACK) || | ||
2248 | (dev->type == ARPHRD_SIT) || | ||
2249 | (dev->type == ARPHRD_TUNNEL6) || | ||
2250 | (dev->type == ARPHRD_FDDI) || | ||
2251 | (dev->type == ARPHRD_IEEE802_TR) || | ||
2252 | (dev->type == ARPHRD_ARCNET) || | ||
2253 | (dev->type == ARPHRD_INFINIBAND)) | ||
2254 | return 1; | ||
2255 | |||
2256 | return 0; | ||
2257 | } | ||
2258 | |||
2253 | static int addrconf_notify(struct notifier_block *this, unsigned long event, | 2259 | static int addrconf_notify(struct notifier_block *this, unsigned long event, |
2254 | void * data) | 2260 | void * data) |
2255 | { | 2261 | { |
2256 | struct net_device *dev = (struct net_device *) data; | 2262 | struct net_device *dev = (struct net_device *) data; |
2257 | struct inet6_dev *idev = __in6_dev_get(dev); | 2263 | struct inet6_dev *idev; |
2258 | int run_pending = 0; | 2264 | int run_pending = 0; |
2259 | 2265 | ||
2266 | if (!ipv6_hwtype(dev)) | ||
2267 | return NOTIFY_OK; | ||
2268 | |||
2269 | idev = __in6_dev_get(dev); | ||
2270 | |||
2260 | switch(event) { | 2271 | switch(event) { |
2261 | case NETDEV_REGISTER: | 2272 | case NETDEV_REGISTER: |
2262 | if (!idev) { | 2273 | if (!idev) { |