diff options
author | Hannes Frederic Sowa <hannes@stressinduktion.org> | 2013-02-09 22:50:18 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-02-11 14:16:26 -0500 |
commit | 2c5e89338493882719f8d138f8f2717ee9a04153 (patch) | |
tree | 8e07ce9bec7a1b34b69e02849aa35566fa34551e | |
parent | 20314092c1b41894d8c181bf9aa6f022be2416aa (diff) |
ipv6: by default join ff01::1 and in case of forwarding ff01::2 and ff05:2
Cc: Erik Hugne <erik.hugne@ericsson.com>
Cc: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | include/linux/in6.h | 9 | ||||
-rw-r--r-- | net/ipv6/addrconf.c | 15 |
2 files changed, 22 insertions, 2 deletions
diff --git a/include/linux/in6.h b/include/linux/in6.h index a16e19349ec0..34edf1f6c9a3 100644 --- a/include/linux/in6.h +++ b/include/linux/in6.h | |||
@@ -36,4 +36,13 @@ extern const struct in6_addr in6addr_linklocal_allnodes; | |||
36 | extern const struct in6_addr in6addr_linklocal_allrouters; | 36 | extern const struct in6_addr in6addr_linklocal_allrouters; |
37 | #define IN6ADDR_LINKLOCAL_ALLROUTERS_INIT \ | 37 | #define IN6ADDR_LINKLOCAL_ALLROUTERS_INIT \ |
38 | { { { 0xff,2,0,0,0,0,0,0,0,0,0,0,0,0,0,2 } } } | 38 | { { { 0xff,2,0,0,0,0,0,0,0,0,0,0,0,0,0,2 } } } |
39 | extern const struct in6_addr in6addr_interfacelocal_allnodes; | ||
40 | #define IN6ADDR_INTERFACELOCAL_ALLNODES_INIT \ | ||
41 | { { { 0xff,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1 } } } | ||
42 | extern const struct in6_addr in6addr_interfacelocal_allrouters; | ||
43 | #define IN6ADDR_INTERFACELOCAL_ALLROUTERS_INIT \ | ||
44 | { { { 0xff,1,0,0,0,0,0,0,0,0,0,0,0,0,0,2 } } } | ||
45 | extern const struct in6_addr in6addr_sitelocal_allrouters; | ||
46 | #define IN6ADDR_SITELOCAL_ALLROUTERS_INIT \ | ||
47 | { { { 0xff,5,0,0,0,0,0,0,0,0,0,0,0,0,0,2 } } } | ||
39 | #endif | 48 | #endif |
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index bd9f9360f769..86c235d05aba 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c | |||
@@ -244,6 +244,9 @@ const struct in6_addr in6addr_any = IN6ADDR_ANY_INIT; | |||
244 | const struct in6_addr in6addr_loopback = IN6ADDR_LOOPBACK_INIT; | 244 | const struct in6_addr in6addr_loopback = IN6ADDR_LOOPBACK_INIT; |
245 | const struct in6_addr in6addr_linklocal_allnodes = IN6ADDR_LINKLOCAL_ALLNODES_INIT; | 245 | const struct in6_addr in6addr_linklocal_allnodes = IN6ADDR_LINKLOCAL_ALLNODES_INIT; |
246 | const struct in6_addr in6addr_linklocal_allrouters = IN6ADDR_LINKLOCAL_ALLROUTERS_INIT; | 246 | const struct in6_addr in6addr_linklocal_allrouters = IN6ADDR_LINKLOCAL_ALLROUTERS_INIT; |
247 | const struct in6_addr in6addr_interfacelocal_allnodes = IN6ADDR_INTERFACELOCAL_ALLNODES_INIT; | ||
248 | const struct in6_addr in6addr_interfacelocal_allrouters = IN6ADDR_INTERFACELOCAL_ALLROUTERS_INIT; | ||
249 | const struct in6_addr in6addr_sitelocal_allrouters = IN6ADDR_SITELOCAL_ALLROUTERS_INIT; | ||
247 | 250 | ||
248 | /* Check if a valid qdisc is available */ | 251 | /* Check if a valid qdisc is available */ |
249 | static inline bool addrconf_qdisc_ok(const struct net_device *dev) | 252 | static inline bool addrconf_qdisc_ok(const struct net_device *dev) |
@@ -428,6 +431,9 @@ static struct inet6_dev *ipv6_add_dev(struct net_device *dev) | |||
428 | /* protected by rtnl_lock */ | 431 | /* protected by rtnl_lock */ |
429 | rcu_assign_pointer(dev->ip6_ptr, ndev); | 432 | rcu_assign_pointer(dev->ip6_ptr, ndev); |
430 | 433 | ||
434 | /* Join interface-local all-node multicast group */ | ||
435 | ipv6_dev_mc_inc(dev, &in6addr_interfacelocal_allnodes); | ||
436 | |||
431 | /* Join all-node multicast group */ | 437 | /* Join all-node multicast group */ |
432 | ipv6_dev_mc_inc(dev, &in6addr_linklocal_allnodes); | 438 | ipv6_dev_mc_inc(dev, &in6addr_linklocal_allnodes); |
433 | 439 | ||
@@ -611,10 +617,15 @@ static void dev_forward_change(struct inet6_dev *idev) | |||
611 | if (idev->cnf.forwarding) | 617 | if (idev->cnf.forwarding) |
612 | dev_disable_lro(dev); | 618 | dev_disable_lro(dev); |
613 | if (dev->flags & IFF_MULTICAST) { | 619 | if (dev->flags & IFF_MULTICAST) { |
614 | if (idev->cnf.forwarding) | 620 | if (idev->cnf.forwarding) { |
615 | ipv6_dev_mc_inc(dev, &in6addr_linklocal_allrouters); | 621 | ipv6_dev_mc_inc(dev, &in6addr_linklocal_allrouters); |
616 | else | 622 | ipv6_dev_mc_inc(dev, &in6addr_interfacelocal_allrouters); |
623 | ipv6_dev_mc_inc(dev, &in6addr_sitelocal_allrouters); | ||
624 | } else { | ||
617 | ipv6_dev_mc_dec(dev, &in6addr_linklocal_allrouters); | 625 | ipv6_dev_mc_dec(dev, &in6addr_linklocal_allrouters); |
626 | ipv6_dev_mc_dec(dev, &in6addr_interfacelocal_allrouters); | ||
627 | ipv6_dev_mc_dec(dev, &in6addr_sitelocal_allrouters); | ||
628 | } | ||
618 | } | 629 | } |
619 | 630 | ||
620 | list_for_each_entry(ifa, &idev->addr_list, if_list) { | 631 | list_for_each_entry(ifa, &idev->addr_list, if_list) { |