pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/net/net-snmp Fix build problem under NetBSD-1.6Y and n...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/1994f16f612f
branches:  trunk
changeset: 461321:1994f16f612f
user:      tron <tron%pkgsrc.org@localhost>
date:      Sun Sep 14 11:57:03 2003 +0000

description:
Fix build problem under NetBSD-1.6Y and newer. This patch was contributed
by Jun-ichiro itojun Hagino.

diffstat:

 net/net-snmp/distinfo         |    3 +-
 net/net-snmp/patches/patch-ab |  237 ++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 239 insertions(+), 1 deletions(-)

diffs (252 lines):

diff -r 7e27b6f7c8d7 -r 1994f16f612f net/net-snmp/distinfo
--- a/net/net-snmp/distinfo     Sun Sep 14 09:10:27 2003 +0000
+++ b/net/net-snmp/distinfo     Sun Sep 14 11:57:03 2003 +0000
@@ -1,5 +1,6 @@
-$NetBSD: distinfo,v 1.2 2003/09/12 12:07:18 uebayasi Exp $
+$NetBSD: distinfo,v 1.3 2003/09/14 11:57:03 tron Exp $
 
 SHA1 (net-snmp-5.0.9.tar.gz) = bb27bdf38da96833a3fa55f8c6a14732ab2c1991
 Size (net-snmp-5.0.9.tar.gz) = 2345822 bytes
 SHA1 (patch-aa) = 40ef03e182f8e8bb4f01f67f97c200c6e82f3d82
+SHA1 (patch-ab) = 94146deb60a3923481c52dc66a64a269641a1265
diff -r 7e27b6f7c8d7 -r 1994f16f612f net/net-snmp/patches/patch-ab
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/net/net-snmp/patches/patch-ab     Sun Sep 14 11:57:03 2003 +0000
@@ -0,0 +1,237 @@
+$NetBSD: patch-ab,v 1.1 2003/09/14 11:57:03 tron Exp $
+
+--- agent/mibgroup/mibII/ipv6.c        12 Sep 2003 23:10:08 -0000      1.1.1.1
++++ agent/mibgroup/mibII/ipv6.c        13 Sep 2003 05:36:50 -0000      1.2
+@@ -1225,6 +1225,10 @@
+     caddr_t         p;
+     static struct in6pcb in6pcb, udb6;
+     int             found, hitnext;
++#if defined(__NetBSD__) && __NetBSD_Version__ >= 106250000    /*1.6Y*/
++    struct inpcbtable udbtable;
++    caddr_t       first;
++#endif
+ #if defined(__FreeBSD__) && __FreeBSD__ >= 3
+     char           *sysctl_buf;
+     struct xinpgen *xig, *oxig;
+@@ -1234,7 +1238,11 @@
+     DEBUGMSGOID(("mibII/ipv6", name, *length));
+     DEBUGMSG(("mibII/ipv6", " %d\n", exact));
+ 
+-#if !(defined(__FreeBSD__) && __FreeBSD__ >= 3)
++#if defined(__NetBSD__) && __NetBSD_Version__ >= 106250000    /*1.6Y*/
++    if (!auto_nlist("udbtable", (char *) &udbtable, sizeof(udbtable)))
++        return NULL;
++    first = p = (caddr_t)udbtable.inpt_queue.cqh_first;
++#elif !(defined(__FreeBSD__) && __FreeBSD__ >= 3)
+     if (!auto_nlist("udb6", (char *) &udb6, sizeof(udb6)))
+         return NULL;
+     p = (caddr_t) udb6.in6p_next;
+@@ -1260,7 +1268,9 @@
+            (int) vp->namelen * sizeof(oid));
+     DEBUGMSGTL(("mibII/ipv6", "start: p=%x\n", p));
+     while (
+-#if !(defined(__FreeBSD__) && __FreeBSD__ >= 3)
++#if defined(__NetBSD__) && __NetBSD_Version__ >= 106250000    /*1.6Y*/
++              p &&  p != first
++#elif !(defined(__FreeBSD__) && __FreeBSD__ >= 3)
+               p && (u_long) p != auto_nlist_value("udb6")
+ #else
+               xig->xig_len > sizeof(struct xinpgen)
+@@ -1273,6 +1283,12 @@
+ #else
+         in6pcb = ((struct xinpcb *) xig)->xi_inp;
+ #endif
++#if defined(__NetBSD__) && __NetBSD_Version__ >= 106250000    /*1.6Y*/
++      if (in6pcb.in6p_af != AF_INET6) {
++          p = (caddr_t)in6pcb.in6p_queue.cqe_next;
++          continue;
++      }
++#endif
+         j = (int) vp->namelen;
+         for (i = 0; i < sizeof(struct in6_addr); i++)
+             newname[j++] = in6pcb.in6p_laddr.s6_addr[i];
+@@ -1325,7 +1341,9 @@
+                 }
+             }
+         }
+-#if !(defined(__FreeBSD__) && __FreeBSD__ >= 3)
++#if defined(__NetBSD__) && __NetBSD_Version__ >= 106250000    /*1.6Y*/
++      p = (caddr_t)in6pcb.in6p_queue.cqe_next;
++#elif !(defined(__FreeBSD__) && __FreeBSD__ >= 3)
+         p = (caddr_t) in6pcb.in6p_next;
+ #else
+         xig = (struct xinpgen *) ((char *) xig + xig->xig_len);
+@@ -1383,6 +1401,10 @@
+     int             found, hitnext;
+     static int      tcp6statemap[TCP6_NSTATES];
+     static int      initialized = 0;
++#if defined(__NetBSD__) && __NetBSD_Version__ >= 106250000    /*1.6Y*/
++    struct inpcbtable tcbtable;
++    caddr_t       first;
++#endif
+ #if defined(__FreeBSD__) && __FreeBSD__ >= 3
+     char           *sysctl_buf;
+     struct xinpgen *xig, *oxig;
+@@ -1407,7 +1429,11 @@
+     DEBUGMSGOID(("mibII/ipv6", name, *length));
+     DEBUGMSG(("mibII/ipv6", " %d\n", exact));
+ 
+-#if !(defined(__FreeBSD__) && __FreeBSD__ >= 3)
++#if defined(__NetBSD__) && __NetBSD_Version__ >= 106250000    /*1.6Y*/
++    if (!auto_nlist("tcbtable", (char *) &tcbtable, sizeof(tcbtable)))
++        return NULL;
++    first = p = (caddr_t)udbtable.inpt_queue.cqh_first;
++#elif !(defined(__FreeBSD__) && __FreeBSD__ >= 3)
+     if (!auto_nlist("tcb6", (char *) &tcb6, sizeof(tcb6)))
+         return NULL;
+     p = (caddr_t) tcb6.in6p_next;
+@@ -1433,7 +1459,9 @@
+     memcpy((char *) newname, (char *) vp->name,
+            (int) vp->namelen * sizeof(oid));
+     while (
+-#if !(defined(__FreeBSD__) && __FreeBSD__ >= 3)
++#if defined(__NetBSD__) && __NetBSD_Version__ >= 106250000    /*1.6Y*/
++              p &&  p != first
++#elif !(defined(__FreeBSD__) && __FreeBSD__ >= 3)
+               p && (u_long) p != auto_nlist_value("tcb6")
+ #else
+               xig->xig_len > sizeof(struct xinpgen)
+@@ -1450,6 +1478,12 @@
+ #else
+         in6pcb = ((struct xinpcb *) xig)->xi_inp;
+ #endif
++#if defined(__NetBSD__) && __NetBSD_Version__ >= 106250000    /*1.6Y*/
++      if (in6pcb.in6p_af != AF_INET6) {
++          p = (caddr_t)in6pcb.in6p_queue.cqe_next;
++          continue;
++      }
++#endif
+         if (klookup
+             ((u_long) in6pcb.in6p_ppcb, (char *) &tcp6cb, sizeof(tcp6cb))
+             < 0) {
+@@ -1520,7 +1554,9 @@
+         }
+ 
+       skip:
+-#if !(defined(__FreeBSD__) && __FreeBSD__ >= 3)
++#if defined(__NetBSD__) && __NetBSD_Version__ >= 106250000    /*1.6Y*/
++      p = (caddr_t)in6pcb.in6p_queue.cqe_next;
++#elif !(defined(__FreeBSD__) && __FreeBSD__ >= 3)
+         p = (caddr_t) in6pcb.in6p_next;
+ #else
+         xig = (struct xinpgen *) ((char *) xig + xig->xig_len);
+@@ -1587,6 +1623,10 @@
+     int             found, hitnext;
+     static int      tcpstatemap[TCP_NSTATES];
+     static int      initialized = 0;
++#if defined(__NetBSD__) && __NetBSD_Version__ >= 106250000    /*1.6Y*/
++    struct inpcbtable tcbtable;
++    caddr_t       first;
++#endif
+ #if defined(__FreeBSD__) && __FreeBSD__ >= 3
+     char           *sysctl_buf;
+     struct xinpgen *xig, *oxig;
+@@ -1611,7 +1651,11 @@
+     DEBUGMSGOID(("mibII/ipv6", name, *length));
+     DEBUGMSG(("mibII/ipv6", " %d\n", exact));
+ 
+-#if !(defined(__FreeBSD__) && __FreeBSD__ >= 3)
++#if defined(__NetBSD__) && __NetBSD_Version__ >= 106250000    /*1.6Y*/
++    if (!auto_nlist("tcbtable", (char *) &tcbtable, sizeof(tcbtable)))
++        return NULL;
++    first = p = (caddr_t)tcbtable.inpt_queue.cqh_first;
++#elif !(defined(__FreeBSD__) && __FreeBSD__ >= 3)
+     if (!auto_nlist("tcb6", (char *) &tcb6, sizeof(tcb6)))
+         return NULL;
+     p = (caddr_t) tcb6.in6p_next;
+@@ -1637,7 +1681,9 @@
+     memcpy((char *) newname, (char *) vp->name,
+            (int) vp->namelen * sizeof(oid));
+     while (
+-#if !(defined(__FreeBSD__) && __FreeBSD__ >= 3)
++#if defined(__NetBSD__) && __NetBSD_Version__ >= 106250000    /*1.6Y*/
++            p && p != first
++#elif !(defined(__FreeBSD__) && __FreeBSD__ >= 3)
+               p && (u_long) p != auto_nlist_value("tcb6")
+ #else
+               xig->xig_len > sizeof(struct xinpgen)
+@@ -1647,14 +1693,20 @@
+ 
+ #if !(defined(__FreeBSD__) && __FreeBSD__ >= 3)
+         if (klookup((u_long) p, (char *) &in6pcb, sizeof(in6pcb)) < 0)
+-#else
+-        in6pcb = ((struct xinpcb *) xig)->xi_inp;
+-#endif
+         {
+             DEBUGMSGTL(("mibII/ipv6", "klookup fail for in6pcb at %x\n",
+                         p));
+             break;
+         }
++#else
++        in6pcb = ((struct xinpcb *) xig)->xi_inp;
++#endif
++#if defined(__NetBSD__) && __NetBSD_Version__ >= 106250000    /*1.6Y*/
++      if (in6pcb.in6p_af != AF_INET6) {
++          p = (caddr_t)in6pcb.in6p_queue.cqe_next;
++          continue;
++      }
++#endif
+         if (klookup
+             ((u_long) in6pcb.in6p_ppcb, (char *) &tcpcb, sizeof(tcpcb))
+             < 0) {
+@@ -1725,7 +1777,9 @@
+         }
+ 
+       skip:
+-#if !(defined(__FreeBSD__) && __FreeBSD__ >= 3)
++#if defined(__NetBSD__) && __NetBSD_Version__ >= 106250000    /*1.6Y*/
++      p = (caddr_t)in6pcb.in6p_queue.cqe_next;
++#elif !(defined(__FreeBSD__) && __FreeBSD__ >= 3)
+         p = (caddr_t) in6pcb.in6p_next;
+ #else
+         xig = (struct xinpgen *) ((char *) xig + xig->xig_len);
+Index: agent/mibgroup/mibII/tcpTable.c
+===================================================================
+RCS file: /cvsroot/apps/net-snmp/agent/mibgroup/mibII/tcpTable.c,v
+retrieving revision 1.1.1.1
+retrieving revision 1.2
+diff -u -r1.1.1.1 -r1.2
+--- agent/mibgroup/mibII/tcpTable.c    12 Sep 2003 23:10:08 -0000      1.1.1.1
++++ agent/mibgroup/mibII/tcpTable.c    13 Sep 2003 05:36:50 -0000      1.2
+@@ -499,6 +499,10 @@
+             snmp_log_perror("TCP_Count_Connections - inpcb");
+             break;
+         }
++#if defined(__NetBSD__) && __NetBSD_Version__ >= 106250000    /*1.6Y*/
++      if (inpcb.inp_af != AF_INET)
++          continue;
++#endif
+ #if !(defined(freebsd2) || defined(netbsd1) || defined(openbsd2))
+         if (inpcb.INP_PREV_SYMBOL != prev) {    /* ??? */
+             sleep(1);
+Index: agent/mibgroup/mibII/udpTable.c
+===================================================================
+RCS file: /cvsroot/apps/net-snmp/agent/mibgroup/mibII/udpTable.c,v
+retrieving revision 1.1.1.1
+retrieving revision 1.2
+diff -u -r1.1.1.1 -r1.2
+--- agent/mibgroup/mibII/udpTable.c    12 Sep 2003 23:10:08 -0000      1.1.1.1
++++ agent/mibgroup/mibII/udpTable.c    13 Sep 2003 05:36:50 -0000      1.2
+@@ -178,6 +178,16 @@
+     LowState = -1;              /* UDP doesn't have 'State', but it's a useful flag */
+     UDP_Scan_Init();
+     for (;;) {
++#if defined(__NetBSD__) && __NetBSD_Version__ >= 106250000    /*1.6Y*/
++      if (inpcb.inp_af != AF_INET) {
++          if ((i = UDP_Scan_Next(&inpcb)) < 0)
++              goto Again;
++          if (i == 0)
++              break;              /* Done */
++          cp = (u_char *) & inpcb.inp_laddr.s_addr;
++          continue;
++      }
++#endif
+ #ifdef hpux11
+         if ((i = UDP_Scan_Next(&udp)) == 0)
+             break;              /* Done */
+



Home | Main Index | Thread Index | Old Index