提交 149ddd83 编写于 作者: S stephen hemminger 提交者: David S. Miller

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: NThomas Graf <tgraf@suug.ch>
Signed-off-by: NStephen Hemminger <shemminger@vyatta.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 d7ffde35
...@@ -240,6 +240,7 @@ int br_add_bridge(struct net *net, const char *name) ...@@ -240,6 +240,7 @@ int br_add_bridge(struct net *net, const char *name)
return -ENOMEM; return -ENOMEM;
dev_net_set(dev, net); dev_net_set(dev, net);
dev->rtnl_link_ops = &br_link_ops;
res = register_netdev(dev); res = register_netdev(dev);
if (res) if (res)
......
...@@ -208,7 +208,7 @@ static int br_validate(struct nlattr *tb[], struct nlattr *data[]) ...@@ -208,7 +208,7 @@ static int br_validate(struct nlattr *tb[], struct nlattr *data[])
return 0; return 0;
} }
static struct rtnl_link_ops br_link_ops __read_mostly = { struct rtnl_link_ops br_link_ops __read_mostly = {
.kind = "bridge", .kind = "bridge",
.priv_size = sizeof(struct net_bridge), .priv_size = sizeof(struct net_bridge),
.setup = br_dev_setup, .setup = br_dev_setup,
......
...@@ -549,6 +549,7 @@ extern int (*br_fdb_test_addr_hook)(struct net_device *dev, unsigned char *addr) ...@@ -549,6 +549,7 @@ extern int (*br_fdb_test_addr_hook)(struct net_device *dev, unsigned char *addr)
#endif #endif
/* br_netlink.c */ /* br_netlink.c */
extern struct rtnl_link_ops br_link_ops;
extern int br_netlink_init(void); extern int br_netlink_init(void);
extern void br_netlink_fini(void); extern void br_netlink_fini(void);
extern void br_ifinfo_notify(int event, struct net_bridge_port *port); extern void br_ifinfo_notify(int event, struct net_bridge_port *port);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册