Don Hackett: [BIND-BUGS #1090] [bind bug] leading zero's give bad address

Rick Jones raj at cup.hp.com
Fri Sep 1 22:20:19 UTC 2000


fwif, this is what happens with inet_addr() under HP-UX 11:

$ cat foo.c
#include <stdio.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>

main()
{
  in_addr_t address;

  address = inet_addr("15.8.80.176");
  printf("address 15.8.80.176 becomes %x\n",address);
  address = inet_addr("015.008.080.176");
  printf("address 015.008.080.176 becomes %x\n",address);

}
$ ./foo
address 15.8.80.176 becomes f0850b0
address 015.008.080.176 becomes d0840b0

it is also what happens under HP-UX 10.20:

$ ./foo
address 15.8.80.176 becomes f0850b0
address 015.008.080.176 becomes d0840b0

this is what happens under Solaris 7:

SunOS hpgsp33 5.7 Generic sun4u sparc SUNW,Ultra-5_10
$ cc -o foo foo.c -lsocket -lnsl
$ ./foo
address 15.8.80.176 becomes f0850b0
address 015.008.080.176 becomes ffffffff

-- 
these opinions are mine, all mine; HP might not want them anyway... :)
feel free to email, OR post, but please do NOT do BOTH...
my email address is raj in the cup.hp.com domain...



More information about the bind-workers mailing list