Do alter your function write_client_addr() to use a fuller
printout:
snprintf(outputbuff, sizeof(outputbuff),
"Address family %d.\n"
"Incoming address is %s.\n",
addr.sin6_family,
addrbuff);
You will probably observe adress family 2 (=AF_INET) every
time you get the alleged "random" number. You have written
your lookup using AF_INET6, thus is fails on AF_INET since
the code is investigating uninitialized memory. Remember
that "in6_addr" and "in_addr" are not at identical offset
in relation to the beginning of "sockaddr_in6" and "sockaddr_in".
If you can prove the same irregularity using "nc6", and if you
rewrite the client to be address family agnostic, then you will
have our full interest again.
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]