[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1403623741.3796.17.camel@edumazet-glaptop2.roam.corp.google.com>
Date: Tue, 24 Jun 2014 08:29:01 -0700
From: Eric Dumazet <eric.dumazet@...il.com>
To: Jamal Hadi Salim <jhs@...atatu.com>
Cc: davem@...emloft.net, stephen@...workplumber.org,
netdev@...r.kernel.org, vyasevic@...hat.com,
sfeldma@...ulusnetworks.com, john.r.fastabend@...el.com,
roopa@...ulusnetworks.com
Subject: Re: [net-next PATCH v2 2/2] bridge: netlink dump interface at par
with brctl
On Tue, 2014-06-24 at 10:15 -0400, Jamal Hadi Salim wrote:
> From: Jamal Hadi Salim <jhs@...atatu.com>
>
...
>
> static int rtnl_fdb_dump(struct sk_buff *skb, struct netlink_callback *cb)
> {
> - int idx = 0;
> - struct net *net = sock_net(skb->sk);
> struct net_device *dev;
> + struct nlattr *tb[IFLA_MAX+1];
> + struct net_device *bdev = NULL;
> + struct net_device *br_dev = NULL;
> + const struct net_device_ops *ops = NULL;
> + const struct net_device_ops *cops = NULL;
> + struct ifinfomsg *ifm = nlmsg_data(cb->nlh);
> + struct net *net = sock_net(skb->sk);
> + int brport_idx = 0;
> + int br_idx = 0;
> + int idx = 0;
> +
> + if (nlmsg_parse(cb->nlh, sizeof(struct ifinfomsg), tb, IFLA_MAX,
> + ifla_policy) == 0) {
> + if (tb[IFLA_MASTER])
> + br_idx = nla_get_u32(tb[IFLA_MASTER]);
> + }
> +
> + brport_idx = ifm->ifi_index;
> +
> + if (br_idx) {
> + br_dev = __dev_get_by_index(net, br_idx);
> + if (!br_dev) {
> + return -ENODEV;
> + }
> + ops = br_dev->netdev_ops;
> + bdev = br_dev;
> + }
>
> - rcu_read_lock();
> for_each_netdev_rcu(net, dev) {
for_each_netdev()
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists