mdns stuff in intercept_finish is broken

Hal Murray hmurray at megapathdsl.net
Mon Nov 30 10:38:49 UTC 2015


I think it only gets tested on NetBSD.

The first problem is that it doesn't include the header file.
The second is that mdns is over in ntpd.c

I think the idea of moving that much actual code over there is a bad idea.

If you want to leave everything there, I suggest commenting out the mdns 
stuff and adding a big note.

--------

This looks fishy :
        sig_desc = NULL;
        sig_desc = strsignal(sig);
        if (sig_desc == NULL)
                sig_desc = "";

It's leftover from when strsignal might not exist and didn't get cleaned up 
when you removed that ifdef test.  My man page says some systems (not Linux) 
might return NULL on an invalid signal.  I assume anything passed to that 
routine will be valid.

-------

There are 2 ways into that code.  One is via a kill command, probably from 
something like "service ntpd stop".  The other is from a SIGBUS.  The SIGBUS 
case should probably bypass the cleanup and exit non-zero.

I think the idea of doing more than a simple log message and exit is to free 
up all the mallocs so the tool that monitors malloc usage would see a close 
to clean result at exit and everything left would be lost memory.  I don't 
see the code I expect.  There is a lot of mallocing in the config file parser 
and big chunks of memory for the mrulist.  The config stuff is using an 
atexit-hook.  That's probably a bad idea if we are going to catch SIGBUS and 
expect to do anything.



-- 
These are my opinions.  I hate spam.





More information about the devel mailing list