[Nut-upsdev] Re: [nut-commits] svn commit r755 - in trunk: . clients

Arjen de Korte nut+devel at de-korte.org
Fri Jan 19 11:19:16 CET 2007



> I see. For IP4 addresses, will ups at 192.168.0.1:3493 still work as
expected? -- Peter

Yes. Whatever is between '@' and the optional ':<portnumber>' is passed as
hostname. Brackets (in case of domain literals) are removed.

One thing to note, in the released versions the use of IPv4 addresses for
a hostname (in upsclient.c) is not guaranteed to work (according to
POSIX):

"The name argument of gethostbyname() shall be a node name; the behavior
of gethostbyname() when passed a numeric address string is unspecified.
For IPv4, a numeric address string shall be in the dotted-decimal notation
described in inet_addr()."

In revision 731, I added gethostbyaddr() to the old non-IPv6 code, which
will retry if gethostbyname() returns a NULL pointer, so this should no
longer be a problem.

Best regards, Arjen
-- 
Eindhoven - The Netherlands
Key fingerprint - 66 4E 03 2C 9D B5 CB 9B  7A FE 7E C1 EE 88 BC 57



-- 





More information about the Nut-upsdev mailing list