[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <56CE8A35.4090503@cumulusnetworks.com>
Date: Wed, 24 Feb 2016 20:59:33 -0800
From: roopa <roopa@...ulusnetworks.com>
To: "Rosen, Rami" <rami.rosen@...el.com>
CC: "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"jhs@...atatu.com" <jhs@...atatu.com>
Subject: Re: [PATCH net-next RFC] rtnetlink: add new RTM_GETSTATS to dump
link stats
On 2/23/16, 1:26 AM, Rosen, Rami wrote:
> Hi,
>
> + if (!dev)
> + return -ENODEV;
> +
> + nskb = nlmsg_new(if_nlmsg_stats_size(dev), GFP_KERNEL);
> + if (!nskb)
> + return -ENOBUFS;
> +
> + err = rtnl_fill_statsinfo(nskb, dev, RTM_NEWSTATS,
> + NETLINK_CB(skb).portid, nlh->nlmsg_seq, 0, 0);
> + if (err < 0) {
>
> It should be here: -EMSGSIZE implies BUG in if_nlmsg_stats_size (instead of if_nlmsg_size)
>
> + /* -EMSGSIZE implies BUG in if_nlmsg_size */
> + WARN_ON(err == -EMSGSIZE);
> + kfree_skb(nskb);
> + } else {
> + err = rtnl_unicast(nskb, net, NETLINK_CB(skb).portid);
> + }
>
>
> Other than that, it seems ok, thanks for this patch!
>
>
will fix it, thanks for the review.
Powered by blists - more mailing lists