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

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

 



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.

In rare cases we can reach there when it's a true error: I add the 
necessary check and return a proper error code.

Best regards,
Jozsef
-
E-mail  : kadlec@xxxxxxxxxxxxxxxxx, kadlec@xxxxxxxxxxxx
PGP key : http://www.kfki.hu/~kadlec/pgp_public_key.txt
Address : KFKI Research Institute for Particle and Nuclear Physics
          H-1525 Budapest 114, POB. 49, Hungary
--
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