[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <C824857E.35C36%scofeldm@cisco.com>
Date: Thu, 27 May 2010 20:24:30 -0700
From: Scott Feldman <scofeldm@...co.com>
To: Patrick McHardy <kaber@...sh.net>
CC: <davem@...emloft.net>, <netdev@...r.kernel.org>,
<chrisw@...hat.com>, <arnd@...db.de>
Subject: Re: [net-next-2.6 V9 PATCH 1/2] Add netlink support for virtual port
management (was iovnl)
On 5/20/10 7:24 AM, "Patrick McHardy" <kaber@...sh.net> wrote:
> Scott Feldman wrote:
>> +static int rtnl_vf_ports_fill(struct sk_buff *skb, struct net_device *dev)
>> +{
>> + struct nlattr *vf_ports;
>> + struct nlattr *vf_port;
>> + int vf;
>> + int err;
>> +
>> + vf_ports = nla_nest_start(skb, IFLA_VF_PORTS);
>> + if (!vf_ports)
>> + return -EMSGSIZE;
>> +
>> + for (vf = 0; vf < dev_num_vf(dev->dev.parent); vf++) {
>> + vf_port = nla_nest_start(skb, IFLA_VF_PORT);
>> + if (!vf_port) {
>> + nla_nest_cancel(skb, vf_ports);
>> + return -EMSGSIZE;
>> + }
>> + NLA_PUT_U32(skb, IFLA_PORT_VF, vf);
>> + err = dev->netdev_ops->ndo_get_vf_port(dev, vf, skb);
>> + if (err) {
>> +nla_put_failure:
>> + nla_nest_cancel(skb, vf_port);
>> + continue;
>
> Are you sure you want to continue here? During a full dump
> this means that the last VF port fitting in the skb will most
> likely be incomplete since the higher layer code won't
> notice that the size was exceeded and the entry should be
> dumped into another skb.
Drats, that's a bug. I'll get that fixed. Thanks Patrick for catching it.
-scott
--
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