Commit 149ddd83a92b02c658d6c61f3276eb6500d585e8

Authored by stephen hemminger
Committed by David S. Miller
1 parent d7ffde35e3

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>

Showing 3 changed files with 3 additions and 1 deletions Side-by-side Diff

... ... @@ -240,6 +240,7 @@
240 240 return -ENOMEM;
241 241  
242 242 dev_net_set(dev, net);
  243 + dev->rtnl_link_ops = &br_link_ops;
243 244  
244 245 res = register_netdev(dev);
245 246 if (res)
net/bridge/br_netlink.c
... ... @@ -208,7 +208,7 @@
208 208 return 0;
209 209 }
210 210  
211   -static struct rtnl_link_ops br_link_ops __read_mostly = {
  211 +struct rtnl_link_ops br_link_ops __read_mostly = {
212 212 .kind = "bridge",
213 213 .priv_size = sizeof(struct net_bridge),
214 214 .setup = br_dev_setup,
net/bridge/br_private.h
... ... @@ -549,6 +549,7 @@
549 549 #endif
550 550  
551 551 /* br_netlink.c */
  552 +extern struct rtnl_link_ops br_link_ops;
552 553 extern int br_netlink_init(void);
553 554 extern void br_netlink_fini(void);
554 555 extern void br_ifinfo_notify(int event, struct net_bridge_port *port);