This is the mail archive of the
glibc-bugs@sources.redhat.com
mailing list for the glibc project.
[Bug libc/223] New: IN_CLASS{A,B,C,D} assume argument is in host byte order
- From: "camh+rhbz at xdna dot net" <sourceware-bugzilla at sources dot redhat dot com>
- To: glibc-bugs at sources dot redhat dot com
- Date: 17 Jun 2004 04:53:45 -0000
- Subject: [Bug libc/223] New: IN_CLASS{A,B,C,D} assume argument is in host byte order
- Reply-to: sourceware-bugzilla at sources dot redhat dot com
The macro "functions" IN_CLASSA, IN_CLASSB, IN_CLASSC and IN_CLASSD in the file
/usr/include/netinet/in.h work only if the argument passed is in host byte
order. However, in_addr_t is in network byte order, so the tests fail on a
little-endian machine (x86).
-------
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <assert.h>
int main(int ac, char ** av)
{
in_addr_t x = inet_addr("10.0.0.128");
assert(IN_CLASSA(x)); /* should pass, but fails */
return 0;
}
-------
--
Summary: IN_CLASS{A,B,C,D} assume argument is in host byte order
Product: glibc
Version: unspecified
Status: NEW
Severity: normal
Priority: P2
Component: libc
AssignedTo: gotom at debian dot or dot jp
ReportedBy: camh+rhbz at xdna dot net
CC: glibc-bugs at sources dot redhat dot com
http://sources.redhat.com/bugzilla/show_bug.cgi?id=223
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.