aboutsummaryrefslogtreecommitdiffstats
path: root/net/bridge
diff options
context:
space:
mode:
authorstephen hemminger <shemminger@vyatta.com>2012-06-26 01:48:45 -0400
committerDavid S. Miller <davem@davemloft.net>2012-06-27 00:12:32 -0400
commit149ddd83a92b02c658d6c61f3276eb6500d585e8 (patch)
tree971f008d720e7c57f28de77cecfd3ea0eb2164e3 /net/bridge
parentd7ffde35e31a81100d2d0d2c4013cbf527bb32ea (diff)
bridge: Assign rtnl_link_ops to bridge devices created via ioctl (v2)
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>
Diffstat (limited to 'net/bridge')
-rw-r--r--net/bridge/br_if.c1
-rw-r--r--net/bridge/br_netlink.c2
-rw-r--r--net/bridge/br_private.h1
3 files changed, 3 insertions, 1 deletions
diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c
index 0a942fbccc9a..e1144e1617be 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)
240 return -ENOMEM; 240 return -ENOMEM;
241 241
242 dev_net_set(dev, net); 242 dev_net_set(dev, net);
243 dev->rtnl_link_ops = &br_link_ops;
243 244
244 res = register_netdev(dev); 245 res = register_netdev(dev);
245 if (res) 246 if (res)
diff --git a/net/bridge/br_netlink.c b/net/bridge/br_netlink.c
index 2080485515f1..fe41260fbf38 100644
--- a/net/bridge/br_netlink.c
+++ b/net/bridge/br_netlink.c
@@ -208,7 +208,7 @@ static int br_validate(struct nlattr *tb[], struct nlattr *data[])
208 return 0; 208 return 0;
209} 209}
210 210
211static struct rtnl_link_ops br_link_ops __read_mostly = { 211struct rtnl_link_ops br_link_ops __read_mostly = {
212 .kind = "bridge", 212 .kind = "bridge",
213 .priv_size = sizeof(struct net_bridge), 213 .priv_size = sizeof(struct net_bridge),
214 .setup = br_dev_setup, 214 .setup = br_dev_setup,
diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h
index 1a8ad4fb9a6b..a768b2408edf 100644
--- a/net/bridge/br_private.h
+++ b/net/bridge/br_private.h
@@ -549,6 +549,7 @@ extern int (*br_fdb_test_addr_hook)(struct net_device *dev, unsigned char *addr)
549#endif 549#endif
550 550
551/* br_netlink.c */ 551/* br_netlink.c */
552extern struct rtnl_link_ops br_link_ops;
552extern int br_netlink_init(void); 553extern int br_netlink_init(void);
553extern void br_netlink_fini(void); 554extern void br_netlink_fini(void);
554extern void br_ifinfo_notify(int event, struct net_bridge_port *port); 555extern void br_ifinfo_notify(int event, struct net_bridge_port *port);