[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9B0331B6EBBD0E4684FBFAEDA55776F92CB7E894@HASMSX110.ger.corp.intel.com>
Date: Tue, 23 Feb 2016 09:26:18 +0000
From: "Rosen, Rami" <rami.rosen@...el.com>
To: Roopa Prabhu <roopa@...ulusnetworks.com>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>
CC: "jhs@...atatu.com" <jhs@...atatu.com>,
"Rosen, Rami" <rami.rosen@...el.com>
Subject: RE: [PATCH net-next RFC] rtnetlink: add new RTM_GETSTATS to dump
link stats
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!
Regards,
Rami Rosen
Intel Corporation
Powered by blists - more mailing lists