Don't spam syslog with "inet_ntop(): Address family not supported

by protocol family" when processing requests received from the
UNIX domain socket.

MFC after:	3 days
This commit is contained in:
ru 2011-04-20 08:38:25 +00:00
parent 80925a07fa
commit 34a7fa4984

View File

@ -1214,7 +1214,8 @@ snmpd_input(struct port_input *pi, struct tport *tport)
/*
* In case of AF_INET{6} peer, do hosts_access(5) check.
*/
if (inet_ntop(pi->peer->sa_family,
if (pi->peer->sa_family != AF_LOCAL &&
inet_ntop(pi->peer->sa_family,
&((const struct sockaddr_in *)(const void *)pi->peer)->sin_addr,
client, sizeof(client)) != NULL) {
request_set(&req, RQ_CLIENT_ADDR, client, 0);
@ -1223,7 +1224,7 @@ snmpd_input(struct port_input *pi, struct tport *tport)
eval_client(&req));
return (-1);
}
} else
} else if (pi->peer->sa_family != AF_LOCAL)
syslog(LOG_ERR, "inet_ntop(): %m");
#endif