Date: Thu, 17 Oct 2013 12:03:17 +0000 (UTC) From: Shteryana Shopova <syrinx@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256680 - head/contrib/bsnmp/lib Message-ID: <201310171203.r9HC3HPl054093@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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); } /*
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201310171203.r9HC3HPl054093>