Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 10 Aug 2014 10:42:04 GMT
From:      shonali@FreeBSD.org
To:        svn-soc-all@FreeBSD.org
Subject:   socsvn commit: r272166 - soc2014/shonali/head/contrib/bsnmp/snmpd
Message-ID:  <201408101042.s7AAg4lh012294@socsvn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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 <sys/types.h>
 #include <sys/queue.h>
@@ -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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201408101042.s7AAg4lh012294>