I attach the patch of snmplib/snmpTCPIPv6Domain.c (for net-snmp 5.2).
  Please try it.

Katsuhisa ABE
Cyber Solutions Inc.

From: Katsuhisa ABE <[EMAIL PROTECTED]>
Subject: Re: Using Net-Snmp for IPv6 and IPv4 simultaneously for both TCP and 
UDP.
Date: Wed, 26 Jan 2005 11:06:58 +0900 (JST)
Message-ID: <[EMAIL PROTECTED]>

abekatsu>   Hi, Sasson.
abekatsu> 
abekatsu>   I think, we need the following setsockopt option
abekatsu> in snmplib/snmpTCPIPv6Domin.c as the same as 
snmplib/snmpUDPIPv6Domain.c.
(snip)
abekatsu> If possible, I will make a patch for snmplib/snmpTCPIPv6Domain.c.
--- snmplib/snmpTCPIPv6Domain.c.orig    Wed Jan 26 15:12:52 2005
+++ snmplib/snmpTCPIPv6Domain.c Wed Jan 26 15:13:31 2005
@@ -310,6 +310,16 @@
          * be INADDR_ANY, but certainly includes a port number.
          */
 
+#ifdef IPV6_V6ONLY
+        /* Try to restrict PF_INET6 socket to IPv6 communications only. */
+        {
+         int one=1;
+         if (setsockopt(t->sock, IPPROTO_IPV6, IPV6_V6ONLY, (char *)&one, 
sizeof(one)) != 0) {
+           DEBUGMSGTL(("netsnmp_udp6", "couldn't set IPV6_V6ONLY to %d bytes: 
%s\n", one, strerror(errno)));
+         } 
+       }
+#endif
+
         t->flags |= NETSNMP_TRANSPORT_FLAG_LISTEN;
         t->local = malloc(18);
         if (t->local == NULL) {

Reply via email to