vos_dottedIP uses inet_addr() to convert form dooted decimal string to uint32_t. This involves the risk to get -1 returned in case of invalid addresses given in the string. Please check inet_aton() as replacement - see manpage excerpt below:
inet_aton() converts the Internet host address cp from the standard
numbers-and-dots notation into binary data and stores it in the struc-
ture that inp points to. inet_aton() returns non-zero if the address is
valid, zero if not.
The inet_addr() function converts the Internet host address cp from
numbers-and-dots notation into binary data in network byte order. If
the input is invalid, INADDR_NONE (usually -1) is returned. This is an
obsolete interface to inet_aton(), described immediately above; it is
obsolete because -1 is a valid address (255.255.255.255), and
inet_aton() provides a cleaner way to indicate error return.
Resolved for Posix-path, only. Windows does not seem to have inet_aton()? What about vxWorks?
A prototype for getting around the 255.255.255.255 problem induced by negative return value "-1" is given for MS Windows, POSIX and vxWorks in [r1332].
Got also some comments in for all parties interested in the differences between the worlds.
Did not invest time on the whereabouts/history of the const qualifier (missing in vxWorks).
Related
Commit: [r1332]
Closing this ticket after revisting the code changes a 2nd time.