diff mbox

IPv6: Fix not join all-router mcast group when forwarding set.

Message ID 4F548D59.1060600@cn.fujitsu.com
State Changes Requested, archived
Delegated to: David Miller
Headers show

Commit Message

Wei Li March 5, 2012, 9:54 a.m. UTC
When forwarding was set and a new net device is register,
we need add this device to the all-router mcast group.

Signed-off-by: Li Wei <lw@cn.fujitsu.com>
---
 net/ipv6/addrconf.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

Comments

David Miller March 5, 2012, 8:11 p.m. UTC | #1
From: Li Wei <lw@cn.fujitsu.com>
Date: Mon, 05 Mar 2012 17:54:33 +0800

> +	/* Join all-router multicast group if forwarding is set */
> +        if (ndev->cnf.forwarding && dev && (dev->flags & IFF_MULTICAST))
> +		ipv6_dev_mc_inc(dev, &in6addr_linklocal_allrouters);

Whitespace damaged.  First line properly uses a TAB, the next uses
spaces and indents too far.

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index c02280a..1e09591 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -434,6 +434,10 @@  static struct inet6_dev * ipv6_add_dev(struct net_device *dev)
 	/* Join all-node multicast group */
 	ipv6_dev_mc_inc(dev, &in6addr_linklocal_allnodes);
 
+	/* Join all-router multicast group if forwarding is set */
+        if (ndev->cnf.forwarding && dev && (dev->flags & IFF_MULTICAST))
+		ipv6_dev_mc_inc(dev, &in6addr_linklocal_allrouters);
+
 	return ndev;
 }