svn commit: r256680 - head/contrib/bsnmp/lib

Shteryana Shopova syrinx at FreeBSD.org
Thu Oct 17 12:03:17 UTC 2013


Author: syrinx
Date: Thu Oct 17 12:03:17 2013
New Revision: 256680
URL: http://svnweb.freebsd.org/changeset/base/256680

Log:
  Fix the -Wconversion warnings produced when compiling the SNMP agent.

Modified:
  head/contrib/bsnmp/lib/snmpagent.c

Modified: head/contrib/bsnmp/lib/snmpagent.c
==============================================================================
--- head/contrib/bsnmp/lib/snmpagent.c	Thu Oct 17 11:50:47 2013	(r256679)
+++ head/contrib/bsnmp/lib/snmpagent.c	Thu Oct 17 12:03:17 2013	(r256680)
@@ -276,7 +276,12 @@ snmp_get(struct snmp_pdu *pdu, struct as
 		}
 	}
 
-	return (snmp_fix_encoding(resp_b, resp));
+	if (snmp_fix_encoding(resp_b, resp) != SNMP_CODE_OK) {
+		snmp_debug("get: failed to encode PDU");
+		return (SNMP_RET_ERR);
+	}
+
+	return (SNMP_RET_OK);
 }
 
 static struct snmp_node *
@@ -438,7 +443,13 @@ snmp_getnext(struct snmp_pdu *pdu, struc
 			return (SNMP_RET_ERR);
 		}
 	}
-	return (snmp_fix_encoding(resp_b, resp));
+
+	if (snmp_fix_encoding(resp_b, resp) != SNMP_CODE_OK) {
+		snmp_debug("getnext: failed to encode PDU");
+		return (SNMP_RET_ERR);
+	}
+
+	return (SNMP_RET_OK);
 }
 
 enum snmp_ret
@@ -537,7 +548,12 @@ snmp_getbulk(struct snmp_pdu *pdu, struc
 	}
 
   done:
-	return (snmp_fix_encoding(resp_b, resp));
+	if (snmp_fix_encoding(resp_b, resp) != SNMP_CODE_OK) {
+		snmp_debug("getnext: failed to encode PDU");
+		return (SNMP_RET_ERR);
+	}
+
+	return (SNMP_RET_OK);
 }
 
 /*


More information about the svn-src-all mailing list