Commit 62b54dd9 authored by Nicolas Dichtel's avatar Nicolas Dichtel Committed by David S. Miller

ipv6: don't add link local route when there is no link local address

When an address is added on loopback (ip -6 a a 2002::1/128 dev lo), a route
to fe80::/64 is added in the main table:
  unreachable fe80::/64 dev lo  proto kernel  metric 256  error -101

This route does not match any prefix (no fe80:: address on lo). In fact,
addrconf_dev_config() will not add link local address because this function
filters interfaces by type. If the link local address is added manually, the
route to the link local prefix will be automatically added by
addrconf_add_linklocal().
Note also, that this route is not deleted when the address is removed.

After looking at the code, it seems that addrconf_add_lroute() is redundant with
addrconf_add_linklocal(), because this function will add the link local route
when the link local address is configured.
Signed-off-by: default avatarNicolas Dichtel <nicolas.dichtel@6wind.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent ffb5ba90
...@@ -1769,14 +1769,6 @@ static void sit_route_add(struct net_device *dev) ...@@ -1769,14 +1769,6 @@ static void sit_route_add(struct net_device *dev)
} }
#endif #endif
static void addrconf_add_lroute(struct net_device *dev)
{
struct in6_addr addr;
ipv6_addr_set(&addr, htonl(0xFE800000), 0, 0, 0);
addrconf_prefix_route(&addr, 64, dev, 0, 0);
}
static struct inet6_dev *addrconf_add_dev(struct net_device *dev) static struct inet6_dev *addrconf_add_dev(struct net_device *dev)
{ {
struct inet6_dev *idev; struct inet6_dev *idev;
...@@ -1794,8 +1786,6 @@ static struct inet6_dev *addrconf_add_dev(struct net_device *dev) ...@@ -1794,8 +1786,6 @@ static struct inet6_dev *addrconf_add_dev(struct net_device *dev)
if (!(dev->flags & IFF_LOOPBACK)) if (!(dev->flags & IFF_LOOPBACK))
addrconf_add_mroute(dev); addrconf_add_mroute(dev);
/* Add link local route */
addrconf_add_lroute(dev);
return idev; return idev;
} }
...@@ -2474,10 +2464,9 @@ static void addrconf_sit_config(struct net_device *dev) ...@@ -2474,10 +2464,9 @@ static void addrconf_sit_config(struct net_device *dev)
sit_add_v4_addrs(idev); sit_add_v4_addrs(idev);
if (dev->flags&IFF_POINTOPOINT) { if (dev->flags&IFF_POINTOPOINT)
addrconf_add_mroute(dev); addrconf_add_mroute(dev);
addrconf_add_lroute(dev); else
} else
sit_route_add(dev); sit_route_add(dev);
} }
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment