Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 23 Apr 2011 05:29:59 +0000 (UTC)
From:      Ruslan Ermilov <ru@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r220964 - stable/8/contrib/bsnmp/snmpd
Message-ID:  <201104230529.p3N5TxjM073362@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ru
Date: Sat Apr 23 05:29:59 2011
New Revision: 220964
URL: http://svn.freebsd.org/changeset/base/220964

Log:
  MFC r220882:
  
  Don't clog syslog up with "inet_ntop(): Address family not supported
  by protocol family" when processing requests received from the UNIX
  domain socket.

Modified:
  stable/8/contrib/bsnmp/snmpd/main.c
Directory Properties:
  stable/8/contrib/bsnmp/   (props changed)

Modified: stable/8/contrib/bsnmp/snmpd/main.c
==============================================================================
--- stable/8/contrib/bsnmp/snmpd/main.c	Sat Apr 23 05:24:17 2011	(r220963)
+++ stable/8/contrib/bsnmp/snmpd/main.c	Sat Apr 23 05:29:59 2011	(r220964)
@@ -909,7 +909,8 @@ snmpd_input(struct port_input *pi, struc
 	/*
 	 * 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);
@@ -918,7 +919,7 @@ snmpd_input(struct port_input *pi, struc
 			    eval_client(&req));
 			return (-1);
 		}
-	} else
+	} else if (pi->peer->sa_family != AF_LOCAL)
 		syslog(LOG_ERR, "inet_ntop(): %m");
 #endif
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201104230529.p3N5TxjM073362>