From owner-svn-soc-all@FreeBSD.ORG Sun Aug 10 10:42:05 2014 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A9CCEBDC for ; Sun, 10 Aug 2014 10:42:05 +0000 (UTC) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9603824E6 for ; Sun, 10 Aug 2014 10:42:05 +0000 (UTC) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7AAg5Du012321 for ; Sun, 10 Aug 2014 10:42:05 GMT (envelope-from shonali@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.9/8.14.9/Submit) id s7AAg4lh012294 for svn-soc-all@FreeBSD.org; Sun, 10 Aug 2014 10:42:04 GMT (envelope-from shonali@FreeBSD.org) Date: Sun, 10 Aug 2014 10:42:04 GMT Message-Id: <201408101042.s7AAg4lh012294@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to shonali@FreeBSD.org using -f From: shonali@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r272166 - soc2014/shonali/head/contrib/bsnmp/snmpd MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Aug 2014 10:42:05 -0000 Author: shonali Date: Sun Aug 10 10:42:04 2014 New Revision: 272166 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=272166 Log: Corrections in export.c, trans_udpv6.c & trap.c Modified: soc2014/shonali/head/contrib/bsnmp/snmpd/export.c soc2014/shonali/head/contrib/bsnmp/snmpd/trans_udpv6.c soc2014/shonali/head/contrib/bsnmp/snmpd/trap.c Modified: soc2014/shonali/head/contrib/bsnmp/snmpd/export.c ============================================================================== --- soc2014/shonali/head/contrib/bsnmp/snmpd/export.c Sun Aug 10 10:11:33 2014 (r272165) +++ soc2014/shonali/head/contrib/bsnmp/snmpd/export.c Sun Aug 10 10:42:04 2014 (r272166) @@ -216,6 +216,7 @@ void ip6_commit(struct snmp_context *ctx __unused) { + free(ctx->scratch->ptr1); } /* Modified: soc2014/shonali/head/contrib/bsnmp/snmpd/trans_udpv6.c ============================================================================== --- soc2014/shonali/head/contrib/bsnmp/snmpd/trans_udpv6.c Sun Aug 10 10:11:33 2014 (r272165) +++ soc2014/shonali/head/contrib/bsnmp/snmpd/trans_udpv6.c Sun Aug 10 10:42:04 2014 (r272166) @@ -34,7 +34,7 @@ * * $Begemot: bsnmp/snmpd/trans_udpv6.c,v 1.5 2005/10/04 08:46:56 brandt_h Exp $ * - * UDP transport + * UDP transport over IPv6 */ #include #include @@ -238,29 +238,29 @@ static ssize_t udpv6_recv(struct tport *tp, struct port_input *pi) { - struct in6_addr *laddr; - int ret; - struct msghdr msg; - char cbuf[CMSG_SPACE(sizeof(struct in6_addr))]; - struct cmsghdr *cmsgp; - - memset(cbuf, 0, CMSG_SPACE(sizeof(struct in6_addr))); - msg.msg_control = cbuf; - msg.msg_controllen = CMSG_SPACE(sizeof(struct in6_addr)); - cmsgp = CMSG_FIRSTHDR(&msg); - cmsgp->cmsg_len = CMSG_LEN(sizeof(struct in6_addr)); - cmsgp->cmsg_level = IPPROTO_IPV6; - cmsgp->cmsg_type = IP_SENDSRCADDR; /* Check for ipv6 alternative */ - laddr = (struct in6_addr *)CMSG_DATA(cmsgp); + struct in6_addr *laddr; + int ret; + struct msghdr msg; + char cbuf[CMSG_SPACE(sizeof(struct in6_addr))]; + struct cmsghdr *cmsgp; + + memset(cbuf, 0, CMSG_SPACE(sizeof(struct in6_addr))); + msg.msg_control = cbuf; + msg.msg_controllen = CMSG_SPACE(sizeof(struct in6_addr)); + cmsgp = CMSG_FIRSTHDR(&msg); + cmsgp->cmsg_len = CMSG_LEN(sizeof(struct in6_addr)); + cmsgp->cmsg_level = IPPROTO_IPV6; + cmsgp->cmsg_type = IP_SENDSRCADDR; /* Check for ipv6 alternative */ + laddr = (struct in6_addr *)CMSG_DATA(cmsgp); - ret = recv_v6dgram(pi, laddr); + ret = recv_v6dgram(pi, laddr); - if (laddr->s6_addr == 0) { - msg.msg_control = NULL; - msg.msg_controllen = 0; - } + if (laddr->s6_addr == 0) { + msg.msg_control = NULL; + msg.msg_controllen = 0; + } - return (ret); + return (ret); } /* @@ -313,9 +313,9 @@ if (msg.msg_flags & MSG_TRUNC) { /* truncated - drop */ - snmpd_stats.silentDrops++; - snmpd_stats.inTooLong++; - return (-1); + snmpd_stats.silentDrops++; + snmpd_stats.inTooLong++; + return (-1); } pi->length = (size_t)len; Modified: soc2014/shonali/head/contrib/bsnmp/snmpd/trap.c ============================================================================== --- soc2014/shonali/head/contrib/bsnmp/snmpd/trap.c Sun Aug 10 10:11:33 2014 (r272165) +++ soc2014/shonali/head/contrib/bsnmp/snmpd/trap.c Sun Aug 10 10:42:04 2014 (r272166) @@ -344,7 +344,7 @@ u_int sub, u_int iidx, enum snmp_op op) { struct trapsink *t; - u_char ipa[4]; + u_char ipa[16]; int32_t port; struct asn_oid idx; struct trapsink_dep *tdep;