0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-30 02:32:43 +01:00

ident: Check getsockname() return value.

This commit is contained in:
Jilles Tjoelker 2008-06-21 01:27:17 +02:00
parent 1a53072881
commit d5d5e89c98

View file

@ -332,8 +332,13 @@ start_auth_query(struct AuthRequest *auth)
* and machines with multiple IP addresses are common now * and machines with multiple IP addresses are common now
*/ */
memset(&localaddr, 0, locallen); memset(&localaddr, 0, locallen);
getsockname(rb_get_fd(auth->client->localClient->F), if(getsockname(rb_get_fd(auth->client->localClient->F),
(struct sockaddr *) &localaddr, &locallen); (struct sockaddr *) &localaddr, &locallen) == -1)
{
/* can happen if connection was just closed */
rb_close(F);
return 0;
}
/* XXX mangle_mapped_sockaddr((struct sockaddr *)&localaddr); */ /* XXX mangle_mapped_sockaddr((struct sockaddr *)&localaddr); */
#ifdef RB_IPV6 #ifdef RB_IPV6