bridge: Add multicast start/stop hooks
authorHerbert Xu <herbert@gondor.apana.org.au>
Sun, 28 Feb 2010 08:49:38 +0000 (00:49 -0800)
committerDavid S. Miller <davem@davemloft.net>
Sun, 28 Feb 2010 08:49:38 +0000 (00:49 -0800)
This patch hooks up the bridge start/stop and add/delete/disable
port functions to the new multicast module.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/bridge/br_device.c
net/bridge/br_if.c
net/bridge/br_stp.c
net/bridge/br_stp_if.c

index be356293caa17d30a15b3eee0fc4695aa2b3d4d5..91dffe7574d6724ab0dd2ca4057f2989f56e5494 100644 (file)
@@ -51,6 +51,7 @@ static int br_dev_open(struct net_device *dev)
        br_features_recompute(br);
        netif_start_queue(dev);
        br_stp_enable_bridge(br);
+       br_multicast_open(br);
 
        return 0;
 }
@@ -61,7 +62,10 @@ static void br_dev_set_multicast_list(struct net_device *dev)
 
 static int br_dev_stop(struct net_device *dev)
 {
-       br_stp_disable_bridge(netdev_priv(dev));
+       struct net_bridge *br = netdev_priv(dev);
+
+       br_stp_disable_bridge(br);
+       br_multicast_stop(br);
 
        netif_stop_queue(dev);
 
index bc2b1badab889fa7511ed1a07fd996d1d65920e4..b6a3872f5681de09a8d67a8fe0ec99cf4ad4dbd1 100644 (file)
@@ -147,6 +147,8 @@ static void del_nbp(struct net_bridge_port *p)
 
        rcu_assign_pointer(dev->br_port, NULL);
 
+       br_multicast_del_port(p);
+
        kobject_uevent(&p->kobj, KOBJ_REMOVE);
        kobject_del(&p->kobj);
 
@@ -207,6 +209,7 @@ static struct net_device *new_bridge_dev(struct net *net, const char *name)
        br_netfilter_rtable_init(br);
 
        br_stp_timer_init(br);
+       br_multicast_init(br);
 
        return dev;
 }
@@ -258,6 +261,7 @@ static struct net_bridge_port *new_nbp(struct net_bridge *br,
        br_init_port(p);
        p->state = BR_STATE_DISABLED;
        br_stp_port_timer_init(p);
+       br_multicast_add_port(p);
 
        return p;
 }
index fd3f8d6c0998adaa1c3c64f506c72ec8bae9b7b6..edcf14b560f6febf68a814418999cbe63ee6dcfd 100644 (file)
@@ -386,6 +386,8 @@ static void br_make_forwarding(struct net_bridge_port *p)
        else
                p->state = BR_STATE_LEARNING;
 
+       br_multicast_enable_port(p);
+
        br_log_state(p);
 
        if (br->forward_delay != 0)
index 9a52ac5b452557ad945aa69e79ed3e86aecd21ef..d527119e9f54fd0d226a60c8f20e669ab506c55c 100644 (file)
@@ -108,6 +108,7 @@ void br_stp_disable_port(struct net_bridge_port *p)
        del_timer(&p->hold_timer);
 
        br_fdb_delete_by_port(br, p, 0);
+       br_multicast_disable_port(p);
 
        br_configuration_update(br);