aboutsummaryrefslogtreecommitdiffstats
path: root/net-mgmt/net-snmp/files/patch-ipv6.c
diff options
context:
space:
mode:
Diffstat (limited to 'net-mgmt/net-snmp/files/patch-ipv6.c')
-rw-r--r--net-mgmt/net-snmp/files/patch-ipv6.c89
1 files changed, 42 insertions, 47 deletions
diff --git a/net-mgmt/net-snmp/files/patch-ipv6.c b/net-mgmt/net-snmp/files/patch-ipv6.c
index 29e2de99aa9..86637254c1c 100644
--- a/net-mgmt/net-snmp/files/patch-ipv6.c
+++ b/net-mgmt/net-snmp/files/patch-ipv6.c
@@ -1,5 +1,5 @@
---- agent/mibgroup/mibII/ipv6.c.orig Thu Jul 8 05:31:54 2004
-+++ agent/mibgroup/mibII/ipv6.c Mon Oct 25 08:32:31 2004
+--- agent/mibgroup/mibII/ipv6.c.orig 2007-05-25 07:01:04.000000000 +0900
++++ agent/mibgroup/mibII/ipv6.c 2008-03-26 07:29:07.122940424 +0900
@@ -8,10 +8,25 @@
#define _KERNEL 1
#define _I_DEFINED_KERNEL
@@ -36,7 +36,7 @@
# if HAVE_NETINET_IN_PCB_H
# include <netinet/in_pcb.h>
# endif
-@@ -575,7 +590,7 @@
+@@ -578,7 +593,7 @@
memcpy(result, &tmp, sizeof(tmp));
return 0;
}
@@ -45,7 +45,7 @@
q = (caddr_t) TAILQ_NEXT(&tmp, if_link);
#else
# if defined(__NetBSD__) || defined(__OpenBSD__)
-@@ -806,7 +821,7 @@
+@@ -809,7 +824,7 @@
if (if_getifnet(interface, &ifnet) < 0)
break;
@@ -54,7 +54,7 @@
ifa = (caddr_t) TAILQ_FIRST(&ifnet.if_addrhead);
#else
# if defined(__NetBSD__) || defined(__OpenBSD__)
-@@ -827,7 +842,7 @@
+@@ -836,7 +851,7 @@
*var_len = sdl.sdl_alen;
return (u_char *) (sdl.sdl_data + sdl.sdl_nlen);
}
@@ -63,7 +63,7 @@
ifa = (caddr_t) TAILQ_NEXT(&ifaddr, ifa_link);
#else
# if defined(__NetBSD__) || defined(__OpenBSD__)
-@@ -1220,32 +1235,33 @@
+@@ -1229,32 +1244,33 @@
size_t * length,
int exact, size_t * var_len, WriteMethod ** write_method)
{
@@ -106,7 +106,7 @@
if (!auto_nlist("udb6", (char *) &udb6, sizeof(udb6)))
return NULL;
p = (caddr_t) udb6.in6p_next;
-@@ -1274,9 +1290,10 @@
+@@ -1283,9 +1299,10 @@
(int) vp->namelen * sizeof(oid));
DEBUGMSGTL(("mibII/ipv6", "start: p=%x\n", p));
while (
@@ -119,14 +119,14 @@
p && (u_long) p != auto_nlist_value("udb6")
#else
xig->xig_len > sizeof(struct xinpgen)
-@@ -1284,31 +1301,32 @@
+@@ -1293,31 +1310,32 @@
) {
DEBUGMSGTL(("mibII/ipv6", "looping: p=%x\n", p));
-#if !(defined(__FreeBSD__) && __FreeBSD__ >= 3) && !defined(darwin)
-- if (klookup((u_long) p, (char *) &in6pcb, sizeof(in6pcb)) < 0) {
+- if (!NETSNMP_KLOOKUP(p, (char *) &in6pcb, sizeof(in6pcb))) {
+#if OS_NOT_FREEBSD_NOR_DARWIN
-+ if (klookup((u_long) p, (char *) &tstpcb, sizeof(tstpcb)) < 0) {
++ if (!NETSNMP_KLOOKUP(p, (char *) &tstpcb, sizeof(tstpcb))) {
DEBUGMSGTL(("mibII/ipv6", "klookup fail for udb6 at %x\n",
p));
found = 0;
@@ -163,7 +163,7 @@
else
newname[j++] = 0;
/*XXX*/
-@@ -1319,7 +1337,7 @@
+@@ -1328,7 +1346,7 @@
result = snmp_oid_compare(name, *length, newname, j);
if (exact && (result == 0)) {
@@ -172,7 +172,7 @@
savnameLen = j;
memcpy(savname, newname, j * sizeof(oid));
found++;
-@@ -1330,7 +1348,7 @@
+@@ -1339,7 +1357,7 @@
*/
if ((savnameLen == 0) ||
(snmp_oid_compare(savname, savnameLen, newname, j) > 0)) {
@@ -181,7 +181,7 @@
savnameLen = j;
memcpy(savname, newname, j * sizeof(oid));
found++;
-@@ -1338,15 +1356,15 @@
+@@ -1347,15 +1365,15 @@
}
skip:
@@ -202,7 +202,7 @@
free(sysctl_buf);
#endif
DEBUGMSGTL(("mibII/ipv6", "found=%d\n", found));
-@@ -1354,7 +1372,7 @@
+@@ -1363,7 +1381,7 @@
return NULL;
*length = savnameLen;
memcpy((char *) name, (char *) savname, *length * sizeof(oid));
@@ -211,7 +211,7 @@
*write_method = 0;
*var_len = sizeof(long); /* default to 'long' results */
-@@ -1367,14 +1385,14 @@
+@@ -1376,14 +1394,14 @@
switch (vp->magic) {
case IPV6UDPLOCALADDRESS:
*var_len = sizeof(struct in6_addr);
@@ -230,7 +230,7 @@
else
long_return = 0;
/*XXX*/ return (u_char *) & long_return;
-@@ -1392,24 +1410,24 @@
+@@ -1401,24 +1419,24 @@
size_t * length,
int exact, size_t * var_len, WriteMethod ** write_method)
{
@@ -262,7 +262,7 @@
#endif
if (!initialized) {
-@@ -1431,11 +1449,11 @@
+@@ -1440,11 +1458,11 @@
DEBUGMSGOID(("mibII/ipv6", name, *length));
DEBUGMSG(("mibII/ipv6", " %d\n", exact));
@@ -276,7 +276,7 @@
if (!auto_nlist("tcb6", (char *) &tcb6, sizeof(tcb6)))
return NULL;
p = (caddr_t) tcb6.in6p_next;
-@@ -1464,9 +1482,10 @@
+@@ -1473,9 +1491,10 @@
(int) vp->namelen * sizeof(oid));
DEBUGMSGTL(("mibII/ipv6", "start: p=%x\n", p));
while (
@@ -289,14 +289,14 @@
p && (u_long) p != auto_nlist_value("tcb6")
#else
xig->xig_len > sizeof(struct xinpgen)
-@@ -1474,41 +1493,41 @@
+@@ -1483,39 +1502,39 @@
) {
DEBUGMSGTL(("mibII/ipv6", "looping: p=%x\n", p));
-#if !(defined(__FreeBSD__) && __FreeBSD__ >= 3) && !defined(darwin)
-- if (klookup((u_long) p, (char *) &in6pcb, sizeof(in6pcb)) < 0) {
+- if (!NETSNMP_KLOOKUP(p, (char *) &in6pcb, sizeof(in6pcb))) {
+#if OS_NOT_FREEBSD_NOR_DARWIN
-+ if (klookup((u_long) p, (char *) &tstpcb, sizeof(tstpcb)) < 0) {
++ if (!NETSNMP_KLOOKUP(p, (char *) &tstpcb, sizeof(tstpcb))) {
DEBUGMSGTL(("mibII/ipv6", "klookup fail for tcb6 at %x\n",
p));
found = 0;
@@ -314,13 +314,11 @@
-#elif (defined(__FreeBSD__) && __FreeBSD__ >= 3) || defined(darwin)
- if (0 == (in6pcb.inp_vflag & INP_IPV6))
+#elif OS_FREEBSD_OR_DARWIN
-+ if (0 == (tstpcb.inp_vflag & INP_IPV6PROTO))
++ if (0 == (tstpcb.inp_vflag & INP_IPV6))
goto skip;
#endif
- if (klookup
-- ((u_long) in6pcb.in6p_ppcb, (char *) &tcp6cb, sizeof(tcp6cb))
-+ ((u_long) tstpcb.in6p_ppcb, (char *) &tcp6cb, sizeof(tcp6cb))
- < 0) {
+- if (!NETSNMP_KLOOKUP(in6pcb.in6p_ppcb, (char *) &tcp6cb, sizeof(tcp6cb))) {
++ if (!NETSNMP_KLOOKUP(tstpcb.in6p_ppcb, (char *) &tcp6cb, sizeof(tcp6cb))) {
DEBUGMSGTL(("mibII/ipv6", "klookup fail for tcb6.tcp6cb at %x\n",
- in6pcb.in6p_ppcb));
+ tstpcb.in6p_ppcb));
@@ -346,7 +344,7 @@
else
newname[j++] = 0;
/*XXX*/ newname[j++] = tcp6statemap[tcp6cb.t_state];
-@@ -1519,13 +1538,13 @@
+@@ -1526,13 +1545,13 @@
DEBUGMSG(("mibII/ipv6", " %d\n", exact));
#if 1 /* this is very odd but sometimes happen, and cause infinite loop */
@@ -362,7 +360,7 @@
savnameLen = j;
memcpy(savname, newname, j * sizeof(oid));
found++;
-@@ -1536,7 +1555,7 @@
+@@ -1543,7 +1562,7 @@
*/
if ((savnameLen == 0) ||
(snmp_oid_compare(savname, savnameLen, newname, j) > 0)) {
@@ -371,7 +369,7 @@
savnameLen = j;
memcpy(savname, newname, j * sizeof(oid));
found++;
-@@ -1544,15 +1563,15 @@
+@@ -1551,15 +1570,15 @@
}
skip:
@@ -392,7 +390,7 @@
free(sysctl_buf);
#endif
DEBUGMSGTL(("mibII/ipv6", "found=%d\n", found));
-@@ -1573,20 +1592,20 @@
+@@ -1580,20 +1599,20 @@
switch (vp->magic) {
case IPV6TCPLOCALADDR:
*var_len = sizeof(struct in6_addr);
@@ -419,7 +417,7 @@
else
long_return = 0;
/*XXX*/ return (u_char *) & long_return;
-@@ -1633,22 +1652,23 @@
+@@ -1640,22 +1659,23 @@
size_t * length,
int exact, size_t * var_len, WriteMethod ** write_method)
{
@@ -450,7 +448,7 @@
#endif
DEBUGMSGTL(("mibII/ipv6", "var_tcp6: "));
-@@ -1688,9 +1708,9 @@
+@@ -1695,9 +1715,9 @@
(int) vp->namelen * sizeof(oid));
DEBUGMSGTL(("mibII/ipv6", "start: p=%x\n", p));
while (
@@ -462,14 +460,14 @@
p && (u_long) p != auto_nlist_value("tcb6")
#else
xig->xig_len > sizeof(struct xinpgen)
-@@ -1698,41 +1718,41 @@
+@@ -1705,39 +1725,39 @@
) {
DEBUGMSGTL(("mibII/ipv6", "looping: p=%x\n", p));
-#if !(defined(__FreeBSD__) && __FreeBSD__ >= 3) && !defined(darwin)
-- if (klookup((u_long) p, (char *) &in6pcb, sizeof(in6pcb)) < 0) {
+- if (!NETSNMP_KLOOKUP(p, (char *) &in6pcb, sizeof(in6pcb))) {
+#if OS_NOT_FREEBSD_NOR_DARWIN
-+ if (klookup((u_long) p, (char *) &tstpcb, sizeof(in6pcb)) < 0) {
++ if (!NETSNMP_KLOOKUP(p, (char *) &tstpcb, sizeof(tstpcb))) {
DEBUGMSGTL(("mibII/ipv6", "klookup fail for tcb6 at %x\n",
p));
found = 0;
@@ -487,16 +485,13 @@
-#elif (defined(__FreeBSD__) && __FreeBSD__ >= 3) || defined(darwin)
- if (0 == (in6pcb.inp_vflag & INP_IPV6))
+#elif OS_FREEBSD_OR_DARWIN
-+ if (0 == (tstpcb.inp_vflag & INP_IPV6PROTO))
++ if (0 == (tstpcb.inp_vflag & INP_IPV6))
goto skip;
#endif
- if (klookup
-- ((u_long) in6pcb.in6p_ppcb, (char *) &tcpcb, sizeof(tcpcb))
-+ ((u_long) tstpcb.in6p_ppcb, (char *) &tcpcb, sizeof(tcpcb))
- < 0) {
-- DEBUGMSGTL(("mibII/ipv6", "klookup fail for tcb6.tcpcb at %x\n",
+- if (!NETSNMP_KLOOKUP(in6pcb.in6p_ppcb, (char *) &tcpcb, sizeof(tcpcb))) {
++ if (!NETSNMP_KLOOKUP(tstpcb.in6p_ppcb, (char *) &tcpcb, sizeof(tcpcb))) {
+ DEBUGMSGTL(("mibII/ipv6", "klookup fail for tcb6.tcpcb at %x\n",
- in6pcb.in6p_ppcb));
-+ DEBUGMSGTL(("mibII/ipv6", "klookup fail for tcb6.tcp6cb at %x\n",
+ tstpcb.in6p_ppcb));
found = 0;
break;
@@ -520,7 +515,7 @@
else
newname[j++] = 0;
/*XXX*/ newname[j++] = mapTcpState((int)tcpcb.t_state);
-@@ -1743,12 +1763,12 @@
+@@ -1748,12 +1768,12 @@
DEBUGMSG(("mibII/ipv6", " %d\n", exact));
#if 1 /* this is very odd but sometimes happen, and cause infinite loop */
@@ -535,7 +530,7 @@
savnameLen = j;
memcpy(savname, newname, j * sizeof(oid));
found++;
-@@ -1759,7 +1779,7 @@
+@@ -1764,7 +1784,7 @@
*/
if ((savnameLen == 0) ||
(snmp_oid_compare(savname, savnameLen, newname, j) > 0)) {
@@ -544,7 +539,7 @@
savnameLen = j;
memcpy(savname, newname, j * sizeof(oid));
found++;
-@@ -1767,15 +1787,15 @@
+@@ -1772,15 +1792,15 @@
}
skip:
@@ -565,7 +560,7 @@
free(sysctl_buf);
#endif
DEBUGMSGTL(("mibII/ipv6", "found=%d\n", found));
-@@ -1783,7 +1803,7 @@
+@@ -1788,7 +1808,7 @@
return NULL;
*length = savnameLen;
memcpy((char *) name, (char *) savname, *length * sizeof(oid));
@@ -574,7 +569,7 @@
*write_method = 0;
*var_len = sizeof(long); /* default to 'long' results */
-@@ -1796,20 +1816,20 @@
+@@ -1801,20 +1821,20 @@
switch (vp->magic) {
case IPV6TCPLOCALADDR:
*var_len = sizeof(struct in6_addr);