Package: libc6-dev Version: 2.11.2-10 Severity: normal Cannot use INADDR_LOOPBACK in a bind call. A code example follows:
server_addr.sin_family = AF_INET; server_addr.sin_port = htons(tcp_server_port); server_addr.sin_addr.s_addr = INADDR_LOOPBACK; ... followed by a bind() call fails. whereas: server_addr.sin_family = AF_INET; server_addr.sin_port = htons(tcp_server_port); server_addr.sin_addr.s_addr = inet_addr("127.0.0.1"); ... works. I printout the two values like below: printf("server_addr.sin_addr.s_add: %ld INADDR_LOOPBACK: %ld\n", server_addr.sin_addr.s_addr, INADDR_LOOPBACK); ...and I get: server_addr.sin_addr.s_add: 16777343 INADDR_LOOPBACK: 2130706433 ...which is odd, I guess the two values should be the same. My includes look like this: #include <stdio.h> #include <sys/types.h> #include <sys/socket.h> #include <errno.h> #include <unistd.h> #include <stdlib.h> #include <string.h> #include <netinet/in.h> ...and netinet/in.h is the one include to have INADDR_LOOPBACK defined. Thanks! -- System Information: Debian Release: 6.0.3 APT prefers stable APT policy: (500, 'stable') Architecture: amd64 (x86_64) Kernel: Linux 2.6.32-5-amd64 (SMP w/2 CPU cores) Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/dash Versions of packages libc6-dev depends on: ii libc-dev-bin 2.11.2-10 Embedded GNU C Library: Developmen ii libc6 2.11.2-10 Embedded GNU C Library: Shared lib ii linux-libc-dev 2.6.32-38 Linux support headers for userspac Versions of packages libc6-dev recommends: ii gcc [c-compiler] 4:4.4.5-1 The GNU C compiler ii gcc-4.1 [c-compiler] 4.1.2-29 The GNU C compiler ii gcc-4.3 [c-compiler] 4.3.5-4 The GNU C compiler ii gcc-4.4 [c-compiler] 4.4.5-8 The GNU C compiler Versions of packages libc6-dev suggests: pn glibc-doc <none> (no description available) ii manpages-dev 3.27-1 Manual pages about using GNU/Linux -- no debconf information -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org