r6222: fixed the socket wrapper code for getsockname()