Skip to contentSkip to conversation

ipset: would it be hard to add /32 pseudo-nets to nethash?

DISCUSSION Torsten Luettgert 2 participants 2 messages Jun 13, 2007 netfilter

lore
Share & tools
lore
#0 lore raw

Hello,

I'm using ipset in some script-generated setup of mine. It's really cool. Now, I found that the "nethash" type really expects networks, i.e. /31 up to /1 networks.
I'd love to have support for single addresses (/32 "networks") in there, too.

Is this a bad idea?

If not so, would it be hard to extend ipset to facilitate this? (Actually, I tried just changing the 31 in ipset_nethash.c's
string_to_number(tmp, 1, 31, &cidr)
to 32, but that didn't work out).

Regards,
Torsten

#1 lore raw

Hi,

Quoted 1 line · Torsten Luettgert

I'm using ipset in some script-generated setup of mine. It's really cool. Now, I found that the "nethash" type really expects networks, i.e. /31 up to /1 networks. I'd love to have support for single addresses (/32 "networks") in there, too.

That won't go: in "nethash" type of sets the network address (32 bit itself) plus the netmask size encoded in 32 bits, which naturally clashes with pure IP addresses. In order to store just IP addresses, use "iphash" type of sets.

Best regards,
Jozsef
-
E-mail : [email protected], [email protected] 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