[Nagiosplug-devel] RFC: netutils.c function change
Karl DeBisschop
karl at debisschop.net
Fri Dec 13 04:50:03 CET 2002
On Tue, 2002-12-10 at 21:27, Jeremy T. Bouse wrote:
> 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 assume that IPPROTO_TCP and IPPROTO_UDP are POSIX-specified and have
been for some time?
If they are in POSIX, in addition to generally available, I would
generally strongly advocate their use. Thus a patch would be likely to
go in quickly.
If not in POSIX, I'd want to do more investigation.
> 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...
I would suggest that waitng is the lesser amount of work for you. I'm
quite enthusiastic about your earlier patch, but where I just moved I've
had serious connectivity issues that have slowed my looking at it. But
it sounds like good thoughtful work, and I hope we can include it very
quickly.
--
Karl DeBisschop <karl at debisschop.net>
More information about the Devel
mailing list