This: #ifdef HAVE_GETPEERNAME #ifdef HAVE_INET6 struct sockaddr_in6 *addr6; struct sockaddr_in6 sock_storage; socklen_t socklen = sizeof (struct sockaddr_in6); #else struct sockaddr_in sock_storage; socklen_t socklen = sizeof (struct sockaddr_in); #endif /* HAVE_INET6 */ struct sockaddr *sockaddr = (struct sockaddr *) &sock_storage; is clearly an aliasing violation: sock_storage is of type struct sockaddr_in6, and *sockaddr is of type struct sockaddr. It would be easy enough to fix the code with a union, but I can't test it because gcj doesn't use this code. I could simply compile with -fno-strict-aliasing. Thoughts? Andrew.