]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
bridge: Assign rtnl_link_ops to bridge devices created via ioctl (v2)
authorstephen hemminger <shemminger@vyatta.com>
Tue, 26 Jun 2012 05:48:45 +0000 (05:48 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 16 Jul 2012 15:47:37 +0000 (08:47 -0700)
[ Upstream commit 149ddd83a92b02c658d6c61f3276eb6500d585e8 ]

This ensures that bridges created with brctl(8) or ioctl(2) directly
also carry IFLA_LINKINFO when dumped over netlink. This also allows
to create a bridge with ioctl(2) and delete it with RTM_DELLINK.

Signed-off-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/bridge/br_if.c
net/bridge/br_netlink.c
net/bridge/br_private.h

index 449087373d883114f4907e5df2e50f362a0e067c..eae6a4e9cbfce7e5c8207d34e2640ff53863e130 100644 (file)
@@ -241,6 +241,7 @@ int br_add_bridge(struct net *net, const char *name)
                return -ENOMEM;
 
        dev_net_set(dev, net);
+       dev->rtnl_link_ops = &br_link_ops;
 
        res = register_netdev(dev);
        if (res)
index 2c16055256802a053b311dac8f4c92e754b63c4c..71861a9c4008a15a21f0ca33445808aa8c051838 100644 (file)
@@ -203,7 +203,7 @@ static int br_validate(struct nlattr *tb[], struct nlattr *data[])
        return 0;
 }
 
-static struct rtnl_link_ops br_link_ops __read_mostly = {
+struct rtnl_link_ops br_link_ops __read_mostly = {
        .kind           = "bridge",
        .priv_size      = sizeof(struct net_bridge),
        .setup          = br_dev_setup,
index 1ca1b1c7560e9398208638541261de971f07b399..7c1f3a09712c95ef841fed81f4de84f60e8a81c6 100644 (file)
@@ -529,6 +529,7 @@ extern int (*br_fdb_test_addr_hook)(struct net_device *dev, unsigned char *addr)
 #endif
 
 /* br_netlink.c */
+extern struct rtnl_link_ops br_link_ops;
 extern int br_netlink_init(void);
 extern void br_netlink_fini(void);
 extern void br_ifinfo_notify(int event, struct net_bridge_port *port);