[Nut-upsdev] Default NUT PORT (errrr...)

Henning Brauer hb-nut at bsws.de
Mon Jan 15 11:53:51 CET 2007


* Peter Selinger <selinger at mathstat.dal.ca> [2007-01-15 04:55]:
> The use of getaddrinfo() is not in itself a good reason to make the
> port a string type. That function is probably not portable anyway.

STANDARDS
     The getaddrinfo() function is defined by the IEEE Std 1003.1g-2000
     (``POSIX'') draft specification and documented in RFC 3493, ``Basic
     Socket Interface Extensions for IPv6''.

experience shows it is very portable.
heck, OpenSSH uses it.

> In this case, --with-port should also take a string, and therefore
> PORT should be #defined as a string. I don't think the interface in
> upsclient.c needs to be changed at all; all that's needed is for
> upscli_splitname() to call getservbyname(3) to generate a numeric
> value.

the approach to convert from string to interger at runtime and doing 
that as early as possible is imo the best option.

-- 
Henning Brauer, hb at bsws.de, henning at openbsd.org
BS Web Services, http://bsws.de
Full-Service ISP - Secure Hosting, Mail and DNS Services
Dedicated Servers, Rootservers, Application Hosting - Hamburg & Amsterdam



More information about the Nut-upsdev mailing list