diff options
author | Nicolas Dichtel <nicolas.dichtel@6wind.com> | 2012-10-01 19:19:14 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-10-02 22:36:23 -0400 |
commit | 62b54dd91567686a1cb118f76a72d5f4764a86dd (patch) | |
tree | 26ea17178e66c20f77ffc599e1bc1e803664dc07 | |
parent | ffb5ba90017505a19e238e986e6d33f09e4df765 (diff) |
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: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | net/ipv6/addrconf.c | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index 480e68422efb..d7c56f8a5b4e 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c | |||
@@ -1769,14 +1769,6 @@ static void sit_route_add(struct net_device *dev) | |||
1769 | } | 1769 | } |
1770 | #endif | 1770 | #endif |
1771 | 1771 | ||
1772 | static void addrconf_add_lroute(struct net_device *dev) | ||
1773 | { | ||
1774 | struct in6_addr addr; | ||
1775 | |||
1776 | ipv6_addr_set(&addr, htonl(0xFE800000), 0, 0, 0); | ||
1777 | addrconf_prefix_route(&addr, 64, dev, 0, 0); | ||
1778 | } | ||
1779 | |||
1780 | static struct inet6_dev *addrconf_add_dev(struct net_device *dev) | 1772 | static struct inet6_dev *addrconf_add_dev(struct net_device *dev) |
1781 | { | 1773 | { |
1782 | struct inet6_dev *idev; | 1774 | struct inet6_dev *idev; |
@@ -1794,8 +1786,6 @@ static struct inet6_dev *addrconf_add_dev(struct net_device *dev) | |||
1794 | if (!(dev->flags & IFF_LOOPBACK)) | 1786 | if (!(dev->flags & IFF_LOOPBACK)) |
1795 | addrconf_add_mroute(dev); | 1787 | addrconf_add_mroute(dev); |
1796 | 1788 | ||
1797 | /* Add link local route */ | ||
1798 | addrconf_add_lroute(dev); | ||
1799 | return idev; | 1789 | return idev; |
1800 | } | 1790 | } |
1801 | 1791 | ||
@@ -2474,10 +2464,9 @@ static void addrconf_sit_config(struct net_device *dev) | |||
2474 | 2464 | ||
2475 | sit_add_v4_addrs(idev); | 2465 | sit_add_v4_addrs(idev); |
2476 | 2466 | ||
2477 | if (dev->flags&IFF_POINTOPOINT) { | 2467 | if (dev->flags&IFF_POINTOPOINT) |
2478 | addrconf_add_mroute(dev); | 2468 | addrconf_add_mroute(dev); |
2479 | addrconf_add_lroute(dev); | 2469 | else |
2480 | } else | ||
2481 | sit_route_add(dev); | 2470 | sit_route_add(dev); |
2482 | } | 2471 | } |
2483 | #endif | 2472 | #endif |