svn commit: r315642 - head/contrib/bsnmp/lib
Ngie Cooper
ngie at FreeBSD.org
Mon Mar 20 17:26:14 UTC 2017
Author: ngie
Date: Mon Mar 20 17:26:13 2017
New Revision: 315642
URL: https://svnweb.freebsd.org/changeset/base/315642
Log:
bsnmp: explicitly test the return value for open_client_{local,udp} in snmp_open(..)
open_client_* returns -1 on failure; 0 on success. Ensure that the return value is
0 -- otherwise exit snmp_open(..).
MFC after: 1 week
Sponsored by: Dell EMC Isilon
Modified:
head/contrib/bsnmp/lib/snmpclient.c
Modified: head/contrib/bsnmp/lib/snmpclient.c
==============================================================================
--- head/contrib/bsnmp/lib/snmpclient.c Mon Mar 20 17:17:54 2017 (r315641)
+++ head/contrib/bsnmp/lib/snmpclient.c Mon Mar 20 17:26:13 2017 (r315642)
@@ -1068,13 +1068,13 @@ snmp_open(const char *host, const char *
switch (snmp_client.trans) {
case SNMP_TRANS_UDP:
- if (open_client_udp(host, port))
+ if (open_client_udp(host, port) != 0)
return (-1);
break;
case SNMP_TRANS_LOC_DGRAM:
case SNMP_TRANS_LOC_STREAM:
- if (open_client_local(host))
+ if (open_client_local(host) != 0)
return (-1);
break;
More information about the svn-src-head
mailing list