Re: [PATCH] netfilter: ipset: export indexes via netlink

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

 



Hi Florent,

On Fri, 27 Jul 2018, Florent Fourcot wrote:

> On pyroute2 library, a method can build a python object based on netlink 
> messages:
> 
> https://github.com/svinota/pyroute2/blob/master/pyroute2/wiset.py#L174
> 
> We could of course fill index attribute with your new command, but that 
> could be nice as well to read it in the same way (list) than other 
> attributes.

Don't get me wrong, I'm just trying to understand how it'd be used.

The rules of set indices are quite straightforward: counted successively 
from zero. When a set is deleted there'll be a hole in the numbering which 
will be reused next when a new set is created. Renaming doesn't change the 
index, however swapping does.

So if one could guarantee that your library alone communicates to the 
ip_set module in the kernel, then it makes sense to pass the indices at 
listing and cache them. However that cannot be guaranteed. So you should 
recheck an index before you use it - and even in that case it's not 
mutable. Therefore I'm reluctant to add it to listing. Do you really gain 
something with it? Wouldn't make sense to add it to the header-only 
listing (as you proposed), to make possible a quick check for all indices?

The two new proposed commands are for direct, single-shot usage.

Best regards,
Jozsef
-
E-mail  : kadlec@xxxxxxxxxxxxxxxxx, kadlecsik.jozsef@xxxxxxxxxxxxx
PGP key : http://www.kfki.hu/~kadlec/pgp_public_key.txt
Address : Wigner Research Centre for Physics, Hungarian Academy of Sciences
          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