diff options
author | Jiri Pirko | 2011-02-13 09:33:42 +0000 |
---|---|---|
committer | David S. Miller | 2011-02-13 16:58:40 -0800 |
commit | afc6151a78a43bdca5f64a8bd3e3c13837580c54 (patch) | |
tree | ec95ce72f88991aeb28df160b4a0215b137b2844 /net/bridge/br_if.c | |
parent | 9232ecca3ecd2e32140118c8fdabd7f8fb9ef4d5 (diff) |
bridge: implement [add/del]_slave ops
add possibility to addif/delif via rtnetlink
Signed-off-by: Jiri Pirko <jpirko@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/bridge/br_if.c')
-rw-r--r-- | net/bridge/br_if.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c index 2a6801d8b728..dce8f0009a12 100644 --- a/net/bridge/br_if.c +++ b/net/bridge/br_if.c @@ -148,6 +148,8 @@ static void del_nbp(struct net_bridge_port *p) netdev_rx_handler_unregister(dev); + netdev_set_master(dev, NULL); + br_multicast_del_port(p); kobject_uevent(&p->kobj, KOBJ_REMOVE); @@ -429,10 +431,14 @@ int br_add_if(struct net_bridge *br, struct net_device *dev) if (br_netpoll_info(br) && ((err = br_netpoll_enable(p)))) goto err3; - err = netdev_rx_handler_register(dev, br_handle_frame, p); + err = netdev_set_master(dev, br->dev); if (err) goto err3; + err = netdev_rx_handler_register(dev, br_handle_frame, p); + if (err) + goto err4; + dev->priv_flags |= IFF_BRIDGE_PORT; dev_disable_lro(dev); @@ -455,6 +461,9 @@ int br_add_if(struct net_bridge *br, struct net_device *dev) kobject_uevent(&p->kobj, KOBJ_ADD); return 0; + +err4: + netdev_set_master(dev, NULL); err3: sysfs_remove_link(br->ifobj, p->dev->name); err2: |