From owner-svn-src-user@freebsd.org Fri Feb 5 23:39:25 2016 Return-Path: Delivered-To: svn-src-user@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BD825A77DC4 for ; Fri, 5 Feb 2016 23:39:25 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 786831FE6; Fri, 5 Feb 2016 23:39:25 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u15NdOU6004042; Fri, 5 Feb 2016 23:39:24 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u15NdONc004041; Fri, 5 Feb 2016 23:39:24 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201602052339.u15NdONc004041@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 5 Feb 2016 23:39:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r295339 - user/ngie/bsnmp_cleanup/contrib/bsnmp/snmpd X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Feb 2016 23:39:25 -0000 Author: ngie Date: Fri Feb 5 23:39:24 2016 New Revision: 295339 URL: https://svnweb.freebsd.org/changeset/base/295339 Log: Checkpoint work to make bsnmpd/main.c compile with WARNS?=6 WIP. Needs to be tested Modified: user/ngie/bsnmp_cleanup/contrib/bsnmp/snmpd/main.c Modified: user/ngie/bsnmp_cleanup/contrib/bsnmp/snmpd/main.c ============================================================================== --- user/ngie/bsnmp_cleanup/contrib/bsnmp/snmpd/main.c Fri Feb 5 21:57:50 2016 (r295338) +++ user/ngie/bsnmp_cleanup/contrib/bsnmp/snmpd/main.c Fri Feb 5 23:39:24 2016 (r295339) @@ -648,11 +648,11 @@ decoded: } else if (usm_user->suser.auth_proto != SNMP_AUTH_NOAUTH && (pdu->engine.engine_boots == 0 || pdu->engine.engine_time == 0)) { snmpd_usmstats.not_in_time_windows++; - ret = SNMP_CODE_FAILED; + ret = SNMPD_INPUT_FAILED; } if ((code = snmp_pdu_auth_access(pdu, ip)) != SNMP_CODE_OK) - ret = SNMP_CODE_FAILED; + ret = SNMPD_INPUT_FAILED; return (ret); } @@ -1169,7 +1169,7 @@ recv_dgram(struct port_input *pi, struct memcpy(laddr, CMSG_DATA(cmsg), sizeof(struct in_addr)); if (cmsg->cmsg_level == SOL_SOCKET && cmsg->cmsg_type == SCM_CREDS) - cred = (struct sockcred *)CMSG_DATA(cmsg); + memcpy(cred, CMSG_DATA(cmsg), sizeof(struct sockcred)); } if (pi->cred) @@ -1207,7 +1207,7 @@ snmpd_input(struct port_input *pi, struc ret = recv_stream(pi); } else { - struct in_addr *laddr; + struct in_addr laddr; memset(cbuf, 0, CMSG_SPACE(sizeof(struct in_addr))); msg.msg_control = cbuf; @@ -1216,11 +1216,11 @@ snmpd_input(struct port_input *pi, struc cmsgp->cmsg_len = CMSG_LEN(sizeof(struct in_addr)); cmsgp->cmsg_level = IPPROTO_IP; cmsgp->cmsg_type = IP_SENDSRCADDR; - laddr = (struct in_addr *)CMSG_DATA(cmsgp); + memcpy(&laddr, CMSG_DATA(cmsgp), sizeof(struct in_addr)); - ret = recv_dgram(pi, laddr); + ret = recv_dgram(pi, &laddr); - if (laddr->s_addr == 0) { + if (laddr.s_addr == 0) { msg.msg_control = NULL; msg.msg_controllen = 0; }