[Pdns-users] LUA iputils netmaskgroup match

bert hubert bert.hubert at powerdns.com
Fri Feb 20 11:53:41 UTC 2015


On Thu, Feb 19, 2015 at 05:40:47PM +0100, Niels Peen wrote:
> Hello,
> 
> I’m using a netmaskgroup to see if a given IP matches:
> 
> if nmg:match(ca) then ..
> 
> This works very well but I would like to know which specific netmask matched. E.g. by having :match (also) return the matching netmask rather than (just) returning true.
> 
> Am I correct that this is currently not possible? If so, could this be considered for a future release?

Hi Niels,

This is currently not possible, but it sounds like a great idea. 

It may be good to know that the netmaskgroup currently just tries all
netmasks to see if one fits, you could easily emulate this in Lua itself,
and it would not be slower. And then you would know which address matched.

Could you open a ticket requesting this feature on github?  Please put a
note in there we find it a fine idea.

	Bert




More information about the Pdns-users mailing list