critical impact:
ntohs and ntohl - different header files (CrCh219)
Problem description
The Tru64 UNIX and HP-UX header files for the ntohs and ntohl functions are different.
On Tru64 UNIX, the routines are defined in the following header file: <arpa/inet.h>
On HP-UX, the routines are defined in the following header file: <netinet/in.h>
For _XOPEN_SOURCE_EXTENDED only, the routines are defined in the
following header file:
<arpa/inet.h> Identifiers
 ntohl |
 ntohs |
|
|
|
|
|
See also
Solution description
Modify the code to include the correct header files.
For ntohs and ntohl to function correctly on HP-UX, change all occurrences of <arpa/inet.h> to <netinet.h>. If you are using UNIX 98 sockets, continue to use <arpa/inet.h>. Note that on HP-UX, ntohs and ntohl are defined as null macros because the host and network byte order are identical. Review the applicable manpages and code for more information. See also
Problem summary
| classifications |
source types |
OS release |
severity |
type |
| NW |
C, C++ |
any HP-UX 11i version |
critical |
changed |
|