--- snmpUDPIPv6Domain.c.org	2004-08-20 13:19:53.000000000 -0700
+++ snmpUDPIPv6Domain.c	2004-08-20 13:21:23.000000000 -0700
@@ -229,6 +229,18 @@
     }
 #endif                          /*SO_BSDCOMPAT */
 
+#ifdef  SO_REUSEADDR
+    /*
+     * Allow the same port to be specified multiple times without failing.
+     *    (useful for a listener)
+     */
+    {
+        int             one = 1;
+        setsockopt(t->sock, SOL_SOCKET, SO_REUSEADDR, (void *) &one,
+                   sizeof(one));
+    }
+#endif                          /*SO_REUSEADDR */
+
     /*
      * Try to set the send and receive buffers to a reasonably large value, so
      * that we can send and receive big PDUs (defaults to 8192 bytes (!) on
@@ -876,6 +888,15 @@
 
 com2Sec6Entry  *com2Sec6List = NULL, *com2Sec6ListLast = NULL;
 
+typedef struct _com2SecEntry {
+    char            community[VACMSTRINGLEN];
+    unsigned long   network;
+    unsigned long   mask;
+    char            secName[VACMSTRINGLEN];
+    struct _com2SecEntry *next;
+} com2SecEntry;
+
+extern com2SecEntry   *com2SecList, *com2SecListLast;
 
 void
 memmove_com2Sec6Entry(com2Sec6Entry * c,
@@ -1200,10 +1221,30 @@
             if (secName != NULL) {
                 *secName = c->secName;
             }
+            goto out;
             break;
         }
         DEBUGMSG(("netsnmp_udp6_getSecName", "... nope\n"));
     }
+    if (IN6_IS_ADDR_V4MAPPED(&from->sin6_addr)) {
+        com2SecEntry *c;
+        for (c = com2SecList; c != NULL; c = c->next) {
+            DEBUGMSGTL(("netsnmp_udp6_getSecName","compare <\"%s\", 0x%08x/0x%08x>",
+                c->community, c->network, c->mask));
+            if ((community_len == strlen(c->community)) &&
+            (memcmp(community, c->community, community_len) == 0) &&
+                ((from->sin6_addr.s6_addr32[3] & c->mask) == c->network)) {
+                DEBUGMSG(("netsnmp_udp_getSecName", "... SUCCESS\n"));
+                if (secName != NULL) {
+                    *secName = c->secName;
+                }
+                break;
+            }
+            DEBUGMSG(("netsnmp_udp_getSecName", "... nope\n"));
+        }
+    }
+ out:
+
     if (ztcommunity != NULL) {
         free(ztcommunity);
     }
