Skip to content

Commit

Permalink
bridge: implement rtnl_link_ops->get_slave_size and rtnl_link_ops->fi…
Browse files Browse the repository at this point in the history
…ll_slave_info

Allow rtnetlink users to get port info in IFLA_INFO_SLAVE_DATA attr

Signed-off-by: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Jiri Pirko authored and David S. Miller committed Sep 9, 2014
1 parent 0f49579 commit ced8283
Showing 1 changed file with 21 additions and 6 deletions.
27 changes: 21 additions & 6 deletions net/bridge/br_netlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,19 @@ static int br_dev_newlink(struct net *src_net, struct net_device *dev,
return register_netdevice(dev);
}

static int br_port_fill_slave_info(struct sk_buff *skb,
const struct net_device *brdev,
const struct net_device *dev)
{
return br_port_fill_attrs(skb, br_port_get_rtnl(dev));
}

static size_t br_port_get_slave_size(const struct net_device *brdev,
const struct net_device *dev)
{
return br_port_info_size();
}

static size_t br_get_link_af_size(const struct net_device *dev)
{
struct net_port_vlans *pv;
Expand All @@ -485,12 +498,14 @@ static struct rtnl_af_ops br_af_ops = {
};

struct rtnl_link_ops br_link_ops __read_mostly = {
.kind = "bridge",
.priv_size = sizeof(struct net_bridge),
.setup = br_dev_setup,
.validate = br_validate,
.newlink = br_dev_newlink,
.dellink = br_dev_delete,
.kind = "bridge",
.priv_size = sizeof(struct net_bridge),
.setup = br_dev_setup,
.validate = br_validate,
.newlink = br_dev_newlink,
.dellink = br_dev_delete,
.get_slave_size = br_port_get_slave_size,
.fill_slave_info = br_port_fill_slave_info,
};

int __init br_netlink_init(void)
Expand Down

0 comments on commit ced8283

Please sign in to comment.