Re: [PATCH 03/13] bitmap:ip set type support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 27.01.2011 10:06, Jozsef Kadlecsik wrote:
> On Tue, 25 Jan 2011, Jozsef Kadlecsik wrote:
> 
>>>> +			} else
>>>> +				goto nla_put_failure;
>>>> +		}
>>>> +		NLA_PUT_IPADDR4(skb, IPSET_ATTR_IP,
>>>> +				htonl(map->first_ip + id * map->hosts));
>>>> +		ipset_nest_end(skb, nested);
>>>> +	}
>>>> +	ipset_nest_end(skb, atd);
>>>> +	/* Set listing finished */
>>>> +	cb->args[2] = 0;
>>>> +	return 0;
>>>> +
>>>> +nla_put_failure:
>>>> +	nla_nest_cancel(skb, nested);
>>>> +	ipset_nest_end(skb, atd);
>>>> +	return 0;
>>>
>>> Doesn't this need to return an errno value to indicate that the
>>> dump is incomplete?
> 
> The success return code was there because in general we reach there when 
> the message gets full. However it does not mean an incomplete dump: the 
> last partially dumped element is cancelled, the outer nesting is finished 
> and we send the success code.
> 
> The nla_put_failure label name can be misleading but I cannot do much 
> about it: NLA_PUT_* relies on it.

Sure, my question was mainly related to whether the ip_set_core needs
to get an indication that the dump was incomplete and needs to be
continued on the next recvmsg() call. But I see now that cb->args[2]
is used to provide this indication, so everything should be fine.
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux