summaryrefslogtreecommitdiff
path: root/net-mgmt/net-snmp/files/patch-ipv6.c
diff options
context:
space:
mode:
authorJun Kuriyama <kuriyama@FreeBSD.org>2003-11-18 03:18:02 +0000
committerJun Kuriyama <kuriyama@FreeBSD.org>2003-11-18 03:18:02 +0000
commitbb25fde9242f916e28ab60e2d8de7b6b419674b7 (patch)
treef2f2184ab455f3516b09f10eb76f3807c9c277aa /net-mgmt/net-snmp/files/patch-ipv6.c
parentUse Tcl/Tk 8.4 rather than 8.3. (diff)
o Upgrade to 5.1 (bump shlib major to 6, use autoconf257).
o Add ${NET_SNMP_MIB_MODULES} which is "host smux ucd-snmp/diskio" by default. o Remove unused variables. o Update various local patches around {tcp,udp}Table and hr_{storage,system}.
Diffstat (limited to 'net-mgmt/net-snmp/files/patch-ipv6.c')
-rw-r--r--net-mgmt/net-snmp/files/patch-ipv6.c105
1 files changed, 105 insertions, 0 deletions
diff --git a/net-mgmt/net-snmp/files/patch-ipv6.c b/net-mgmt/net-snmp/files/patch-ipv6.c
new file mode 100644
index 000000000000..c755184e10c9
--- /dev/null
+++ b/net-mgmt/net-snmp/files/patch-ipv6.c
@@ -0,0 +1,105 @@
+--- agent/mibgroup/mibII/ipv6.c.orig Fri Feb 28 18:13:36 2003
++++ agent/mibgroup/mibII/ipv6.c Tue Nov 18 12:09:09 2003
+@@ -1238,6 +1238,7 @@
+ if (!auto_nlist("udb6", (char *) &udb6, sizeof(udb6)))
+ return NULL;
+ p = (caddr_t) udb6.in6p_next;
++ DEBUGMSGTL(("mibII/ipv6", "start: p=%x\n", p));
+ #else
+ {
+ const char *udblist = "net.inet.udp.pcblist";
+@@ -1254,11 +1255,11 @@
+ oxig = (struct xinpgen *) sysctl_buf;
+ xig = (struct xinpgen *) ((char *) oxig + oxig->xig_len);
+ }
++ DEBUGMSGTL(("mibII/ipv6", "start: xig=%p\n", xig));
+ #endif
+ found = hitnext = 0;
+ memcpy((char *) newname, (char *) vp->name,
+ (int) vp->namelen * sizeof(oid));
+- DEBUGMSGTL(("mibII/ipv6", "start: p=%x\n", p));
+ while (
+ #if !(defined(__FreeBSD__) && __FreeBSD__ >= 3)
+ p && (u_long) p != auto_nlist_value("udb6")
+@@ -1266,12 +1267,16 @@
+ xig->xig_len > sizeof(struct xinpgen)
+ #endif
+ ) {
+- DEBUGMSGTL(("mibII/ipv6", "looping: p=%x\n", p));
+
+ #if !(defined(__FreeBSD__) && __FreeBSD__ >= 3)
++ DEBUGMSGTL(("mibII/ipv6", "looping: p=%x\n", p));
+ klookup((u_long) p, (char *) &in6pcb, sizeof(in6pcb));
+ #else
+ in6pcb = ((struct xinpcb *) xig)->xi_inp;
++ if (!(in6pcb.inp_vflag & 0x02)) { /* Skip non-IPv6 pcb */
++ xig = (struct xinpgen *) ((char *) xig + xig->xig_len);
++ continue;
++ }
+ #endif
+ j = (int) vp->namelen;
+ for (i = 0; i < sizeof(struct in6_addr); i++)
+@@ -1283,8 +1288,8 @@
+ else
+ newname[j++] = 0;
+ /*XXX*/
+- DEBUGMSGTL(("mibII/ipv6", "var_udp6 new: %d %d ",
+- (int) vp->namelen, j));
++ DEBUGMSGTL(("mibII/ipv6", "var_udp6 new: %d %d ",
++ (int) vp->namelen, j));
+ DEBUGMSGOID(("mibII/ipv6", newname, j));
+ DEBUGMSG(("mibII/ipv6", " %d\n", exact));
+
+@@ -1447,9 +1452,6 @@
+ p));
+ break;
+ }
+-#else
+- in6pcb = ((struct xinpcb *) xig)->xi_inp;
+-#endif
+ if (klookup
+ ((u_long) in6pcb.in6p_ppcb, (char *) &tcp6cb, sizeof(tcp6cb))
+ < 0) {
+@@ -1457,6 +1459,14 @@
+ in6pcb.in6p_ppcb));
+ break;
+ }
++#else
++ in6pcb = ((struct xinpcb *) xig)->xi_inp;
++ struct xtcpcb *xp = (struct xtcpcb *)xig;
++ tcp6cb = xp->xt_tp;
++ if (!(in6pcb.inp_vflag & 0x02)) { /* Skip non-IPv6 pcb */
++ goto skip;
++ }
++#endif
+ j = (int) vp->namelen;
+ for (i = 0; i < sizeof(struct in6_addr); i++)
+ newname[j++] = in6pcb.in6p_laddr.s6_addr[i];
+@@ -1646,11 +1656,7 @@
+ DEBUGMSGTL(("mibII/ipv6", "looping: p=%x\n", p));
+
+ #if !(defined(__FreeBSD__) && __FreeBSD__ >= 3)
+- if (klookup((u_long) p, (char *) &in6pcb, sizeof(in6pcb)) < 0)
+-#else
+- in6pcb = ((struct xinpcb *) xig)->xi_inp;
+-#endif
+- {
++ if (klookup((u_long) p, (char *) &in6pcb, sizeof(in6pcb)) < 0) {
+ DEBUGMSGTL(("mibII/ipv6", "klookup fail for in6pcb at %x\n",
+ p));
+ break;
+@@ -1662,6 +1668,14 @@
+ in6pcb.in6p_ppcb));
+ break;
+ }
++#else
++ in6pcb = ((struct xinpcb *) xig)->xi_inp;
++ struct xtcpcb *xp = (struct xtcpcb *)xig;
++ tcp6cb = xp->xt_tp;
++ if (!(in6pcb.inp_vflag & 0x02)) { /* Skip non-IPv6 pcb */
++ goto skip;
++ }
++#endif
+ j = (int) vp->namelen;
+ for (i = 0; i < sizeof(struct in6_addr); i++)
+ newname[j++] = in6pcb.in6p_laddr.s6_addr[i];