[Nagiosplug-devel] RFC: netutils.c function change

Jeremy T. Bouse Jeremy.Bouse at UnderGrid.net
Tue Dec 10 18:30:01 CET 2002


	Just wanted to get some thought on a chance in the code that I
would see as helpful and personally would move towards... In netutils.c
there are functions which pass the "proto" parameter around and usually
it's set to either "udp" or "tcp"... Likewise in the functions there are
strcmp or strcasecmp calls to check which it is... My thought would be
to change the "proto" parameter from 'char *' to 'int' and then use the
IPPROTO_TCP and IPPROTO_UDP defined in netinet/in.h. This makes
conditions easier to test for and also makes the code cleaner... I've
actually patched my local working directory to do this and it works
really nicely and has less SEGV issues when relating to the proto
parameter... 

	I've been doing some general code clean-up and this would be
included in a diff but I'll wait to see what of my previous patch is
accepted before building another one to include these changes... If
someone wants to take a second look at what I have I can try and work
out a patch that applies only to this and submit it...

	Jeremy




More information about the Devel mailing list