diff options
author | stephen hemminger <shemminger@vyatta.com> | 2012-06-26 05:48:45 +0000 |
---|---|---|
committer | Ben Hutchings <ben@decadent.org.uk> | 2012-07-12 04:32:16 +0100 |
commit | 2abafc06328d22a3cc486b060ae1d20d19430141 (patch) | |
tree | 01345b0f915084029f1118988962d6c8baed8096 | |
parent | bb6c2337ae71d5eb2e0c8106d6be2a209f2599df (diff) |
bridge: Assign rtnl_link_ops to bridge devices created via ioctl (v2)
[ 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: Ben Hutchings <ben@decadent.org.uk>
-rw-r--r-- | net/bridge/br_if.c | 1 | ||||
-rw-r--r-- | net/bridge/br_netlink.c | 2 | ||||
-rw-r--r-- | net/bridge/br_private.h | 1 |
3 files changed, 3 insertions, 1 deletions
diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c index f603e5b0b930..f3f75ad93c89 100644 --- a/net/bridge/br_if.c +++ b/net/bridge/br_if.c @@ -240,6 +240,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) diff --git a/net/bridge/br_netlink.c b/net/bridge/br_netlink.c index a1daf8227ed1..cbf9ccd45784 100644 --- a/net/bridge/br_netlink.c +++ b/net/bridge/br_netlink.c @@ -211,7 +211,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, diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h index 93264dfd1da3..b9bba8fb478a 100644 --- a/net/bridge/br_private.h +++ b/net/bridge/br_private.h @@ -536,6 +536,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); |