NSD ACL Plugin

Colm MacCarthaigh colm.maccarthaigh at heanet.ie
Thu Jul 17 11:24:13 UTC 2003

On Thu, Jul 17, 2003 at 11:48:30AM +0200, Erik Rozendaal wrote:
> 0. I modified example-plugin.so to include the following lines in the 
> reload function:
> 	void *key;
> 	void *data;
> 	HEAP_WALK(nsd->nsd->db->heap, key, data) {
> 		fprintf(stderr, "name %s\n", dnamestr(key));
> 	}
>    This also resulted in an infinite loop that was hard to debug.
> Then I made the following changes to make things easier to debug:
> 1. Add the RTLD_GLOBAL flag to the call to dlopen in plugin.c "handle = 
> dlopen(name, RTLD_NOW | RTLD_GLOBAL)".
> 2. Configure with LDFLAGS='-rdynamic' to make global symbols in nsd 
> available to the plugins.
> 3. Do _not_ link rbtree.o into the plugin.
> But now the HEAP_WALK works.  Although I don't know why :(  But hopefully 
> this will help you anyway.

It does, any chance of making those the defaults for 1.2.2 ? The
"why" of it seems to be the RBTREE_NULL macro which expands to a
pointer to an rbnode_t. The two compiles produce differing
addresses for this node, so the code never matches.

> I'm planning to change the name lookup algorithm for NSD 1.3.0 and that 
> should make it much easier to walk over a set of domain names given a 
> parent domain name.  But until then this is your best bet.

I'm getting somewhere now :)

Colm MacCárthaigh  /  HEAnet, Teach Brooklawn,  / Innealtóir Ghréasáin
+353 1 6609040    / Bóthar Shelbourne, BÁC, IE /   http://www.hea.net/

More information about the nsd-users mailing list