diff options
author | Jun Kuriyama <kuriyama@FreeBSD.org> | 2004-11-29 04:08:29 +0000 |
---|---|---|
committer | Jun Kuriyama <kuriyama@FreeBSD.org> | 2004-11-29 04:08:29 +0000 |
commit | 073e7bc6aab0007bcc2023010c1584833ccbd4b7 (patch) | |
tree | 5cd85bbc837231a3a8e2582bc048cd987a899022 /net-mgmt/net-snmp-devel/files/patch-ipv6.c | |
parent | Project is now under the Apache 2.0 license, which is included in the (diff) |
- Upgrade to 5.2.
- Fix build problem on current (1)
- Fix module availability problem on current (2)
- Disable perl completely with WITHOUT_PERL knob (3)
- Install sample file and improve pkg-message and pkg-plist (4)
PR: ports/71071 (1), ports/71522 (2), ports/71315 (3), ports/72779 (4)
Submitted by: Matthew Thyer <thyerm@powerband.net.au> (1),
Dominic Mitchell <dom@happygiraffe.net> (2),
oliver (3),
Fumihiko Kimura <jfkimura@yahoo.co.jp> (4)
Notes
Notes:
svn path=/head/; revision=122733
Diffstat (limited to 'net-mgmt/net-snmp-devel/files/patch-ipv6.c')
-rw-r--r-- | net-mgmt/net-snmp-devel/files/patch-ipv6.c | 87 |
1 files changed, 41 insertions, 46 deletions
diff --git a/net-mgmt/net-snmp-devel/files/patch-ipv6.c b/net-mgmt/net-snmp-devel/files/patch-ipv6.c index 348fe8b3cf86..29e2de99aa97 100644 --- a/net-mgmt/net-snmp-devel/files/patch-ipv6.c +++ b/net-mgmt/net-snmp-devel/files/patch-ipv6.c @@ -1,5 +1,5 @@ ---- agent/mibgroup/mibII/ipv6.c.orig Wed Jun 30 22:35:24 2004 -+++ agent/mibgroup/mibII/ipv6.c Wed Aug 11 20:45:32 2004 +--- 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 @@ -8,10 +8,25 @@ #define _KERNEL 1 #define _I_DEFINED_KERNEL @@ -106,7 +106,7 @@ if (!auto_nlist("udb6", (char *) &udb6, sizeof(udb6))) return NULL; p = (caddr_t) udb6.in6p_next; -@@ -1274,41 +1290,44 @@ +@@ -1274,9 +1290,10 @@ (int) vp->namelen * sizeof(oid)); DEBUGMSGTL(("mibII/ipv6", "start: p=%x\n", p)); while ( @@ -115,11 +115,11 @@ p && p != first -#elif !(defined(__FreeBSD__) && __FreeBSD__ >= 3) && !defined(darwin) +#elif OS_NOT_FREEBSD_NOR_DARWIN ++ p && (u_long) p != auto_nlist_value("udb6") #else xig->xig_len > sizeof(struct xinpgen) - #endif -+ +@@ -1284,31 +1301,32 @@ ) { DEBUGMSGTL(("mibII/ipv6", "looping: p=%x\n", p)); @@ -144,7 +144,6 @@ goto skip; -#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)) goto skip; @@ -159,12 +158,12 @@ + newname[j++] = ntohs(tstpcb.in6p_lport); + if (IN6_IS_ADDR_LINKLOCAL(&tstpcb.in6p_laddr)) newname[j++] = -- ntohs(*(u_int16_t *) & in6pcb.in6p_laddr.s6_addr[2]); -+ ntohs(*(u_int16_t *) & tstpcb.in6p_laddr.s6_addr[2]); +- ntohs(*(uint16_t *) & in6pcb.in6p_laddr.s6_addr[2]); ++ ntohs(*(uint16_t *) & tstpcb.in6p_laddr.s6_addr[2]); else newname[j++] = 0; /*XXX*/ -@@ -1319,7 +1338,7 @@ +@@ -1319,7 +1337,7 @@ result = snmp_oid_compare(name, *length, newname, j); if (exact && (result == 0)) { @@ -173,7 +172,7 @@ savnameLen = j; memcpy(savname, newname, j * sizeof(oid)); found++; -@@ -1330,7 +1349,7 @@ +@@ -1330,7 +1348,7 @@ */ if ((savnameLen == 0) || (snmp_oid_compare(savname, savnameLen, newname, j) > 0)) { @@ -182,7 +181,7 @@ savnameLen = j; memcpy(savname, newname, j * sizeof(oid)); found++; -@@ -1338,15 +1357,15 @@ +@@ -1338,15 +1356,15 @@ } skip: @@ -203,7 +202,7 @@ free(sysctl_buf); #endif DEBUGMSGTL(("mibII/ipv6", "found=%d\n", found)); -@@ -1354,7 +1373,7 @@ +@@ -1354,7 +1372,7 @@ return NULL; *length = savnameLen; memcpy((char *) name, (char *) savname, *length * sizeof(oid)); @@ -212,7 +211,7 @@ *write_method = 0; *var_len = sizeof(long); /* default to 'long' results */ -@@ -1367,14 +1386,14 @@ +@@ -1367,14 +1385,14 @@ switch (vp->magic) { case IPV6UDPLOCALADDRESS: *var_len = sizeof(struct in6_addr); @@ -226,12 +225,12 @@ - if (IN6_IS_ADDR_LINKLOCAL(&in6pcb.in6p_laddr)) + if (IN6_IS_ADDR_LINKLOCAL(&savpcb.in6p_laddr)) long_return = -- ntohs(*(u_int16_t *) & in6pcb.in6p_laddr.s6_addr[2]); -+ ntohs(*(u_int16_t *) & savpcb.in6p_laddr.s6_addr[2]); +- ntohs(*(uint16_t *) & in6pcb.in6p_laddr.s6_addr[2]); ++ ntohs(*(uint16_t *) & savpcb.in6p_laddr.s6_addr[2]); else long_return = 0; /*XXX*/ return (u_char *) & long_return; -@@ -1392,24 +1411,24 @@ +@@ -1392,24 +1410,24 @@ size_t * length, int exact, size_t * var_len, WriteMethod ** write_method) { @@ -263,7 +262,7 @@ #endif if (!initialized) { -@@ -1431,11 +1450,11 @@ +@@ -1431,11 +1449,11 @@ DEBUGMSGOID(("mibII/ipv6", name, *length)); DEBUGMSG(("mibII/ipv6", " %d\n", exact)); @@ -277,7 +276,7 @@ if (!auto_nlist("tcb6", (char *) &tcb6, sizeof(tcb6))) return NULL; p = (caddr_t) tcb6.in6p_next; -@@ -1464,9 +1483,10 @@ +@@ -1464,9 +1482,10 @@ (int) vp->namelen * sizeof(oid)); DEBUGMSGTL(("mibII/ipv6", "start: p=%x\n", p)); while ( @@ -290,7 +289,7 @@ p && (u_long) p != auto_nlist_value("tcb6") #else xig->xig_len > sizeof(struct xinpgen) -@@ -1474,41 +1494,43 @@ +@@ -1474,41 +1493,41 @@ ) { DEBUGMSGTL(("mibII/ipv6", "looping: p=%x\n", p)); @@ -310,12 +309,10 @@ -#if defined(__NetBSD__) && __NetBSD_Version__ >= 106250000 /*1.6Y*/ - if (in6pcb.in6p_af != AF_INET6) +#if OS_NET_BSD_16_OR_LATER -+ if (tstpcb.in6p_af != AF_INET6) { -+ p = (caddr_t)tstpcb.in6p_queue.cqe_next; ++ if (tstpcb.in6p_af != AF_INET6) goto skip; -#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)) goto skip; @@ -344,12 +341,12 @@ + newname[j++] = ntohs(tstpcb.in6p_fport); + if (IN6_IS_ADDR_LINKLOCAL(&tstpcb.in6p_laddr)) newname[j++] = -- ntohs(*(u_int16_t *) & in6pcb.in6p_laddr.s6_addr[2]); -+ ntohs(*(u_int16_t *) & tstpcb.in6p_laddr.s6_addr[2]); +- ntohs(*(uint16_t *) & in6pcb.in6p_laddr.s6_addr[2]); ++ ntohs(*(uint16_t *) & tstpcb.in6p_laddr.s6_addr[2]); else newname[j++] = 0; /*XXX*/ newname[j++] = tcp6statemap[tcp6cb.t_state]; -@@ -1519,13 +1541,13 @@ +@@ -1519,13 +1538,13 @@ DEBUGMSG(("mibII/ipv6", " %d\n", exact)); #if 1 /* this is very odd but sometimes happen, and cause infinite loop */ @@ -365,7 +362,7 @@ savnameLen = j; memcpy(savname, newname, j * sizeof(oid)); found++; -@@ -1536,7 +1558,7 @@ +@@ -1536,7 +1555,7 @@ */ if ((savnameLen == 0) || (snmp_oid_compare(savname, savnameLen, newname, j) > 0)) { @@ -374,7 +371,7 @@ savnameLen = j; memcpy(savname, newname, j * sizeof(oid)); found++; -@@ -1544,15 +1566,15 @@ +@@ -1544,15 +1563,15 @@ } skip: @@ -395,7 +392,7 @@ free(sysctl_buf); #endif DEBUGMSGTL(("mibII/ipv6", "found=%d\n", found)); -@@ -1573,20 +1595,20 @@ +@@ -1573,20 +1592,20 @@ switch (vp->magic) { case IPV6TCPLOCALADDR: *var_len = sizeof(struct in6_addr); @@ -417,12 +414,12 @@ - if (IN6_IS_ADDR_LINKLOCAL(&in6pcb.in6p_laddr)) + if (IN6_IS_ADDR_LINKLOCAL(&savpcb.in6p_laddr)) long_return = -- ntohs(*(u_int16_t *) & in6pcb.in6p_laddr.s6_addr[2]); -+ ntohs(*(u_int16_t *) & savpcb.in6p_laddr.s6_addr[2]); +- ntohs(*(uint16_t *) & in6pcb.in6p_laddr.s6_addr[2]); ++ ntohs(*(uint16_t *) & savpcb.in6p_laddr.s6_addr[2]); else long_return = 0; /*XXX*/ return (u_char *) & long_return; -@@ -1633,22 +1655,23 @@ +@@ -1633,22 +1652,23 @@ size_t * length, int exact, size_t * var_len, WriteMethod ** write_method) { @@ -453,7 +450,7 @@ #endif DEBUGMSGTL(("mibII/ipv6", "var_tcp6: ")); -@@ -1688,9 +1711,9 @@ +@@ -1688,9 +1708,9 @@ (int) vp->namelen * sizeof(oid)); DEBUGMSGTL(("mibII/ipv6", "start: p=%x\n", p)); while ( @@ -465,14 +462,14 @@ p && (u_long) p != auto_nlist_value("tcb6") #else xig->xig_len > sizeof(struct xinpgen) -@@ -1698,41 +1721,43 @@ +@@ -1698,41 +1718,41 @@ ) { 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 OS_NOT_FREEBSD_NOR_DARWIN -+ if (klookup((u_long) p, (char *) &tstpcb, sizeof(tstpcb)) < 0) { ++ if (klookup((u_long) p, (char *) &tstpcb, sizeof(in6pcb)) < 0) { DEBUGMSGTL(("mibII/ipv6", "klookup fail for tcb6 at %x\n", p)); found = 0; @@ -485,12 +482,10 @@ -#if defined(__NetBSD__) && __NetBSD_Version__ >= 106250000 /*1.6Y*/ - if (in6pcb.in6p_af != AF_INET6) +#if OS_NET_BSD_16_OR_LATER -+ if (tstpcb.in6p_af != AF_INET6) { -+ p = (caddr_t)tstpcb.in6p_queue.cqe_next; ++ if (tstpcb.in6p_af != AF_INET6) goto skip; -#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)) goto skip; @@ -520,12 +515,12 @@ + newname[j++] = ntohs(tstpcb.in6p_fport); + if (IN6_IS_ADDR_LINKLOCAL(&tstpcb.in6p_laddr)) newname[j++] = -- ntohs(*(u_int16_t *) & in6pcb.in6p_laddr.s6_addr[2]); -+ ntohs(*(u_int16_t *) & tstpcb.in6p_laddr.s6_addr[2]); +- ntohs(*(uint16_t *) & in6pcb.in6p_laddr.s6_addr[2]); ++ ntohs(*(uint16_t *) & tstpcb.in6p_laddr.s6_addr[2]); else newname[j++] = 0; /*XXX*/ newname[j++] = mapTcpState((int)tcpcb.t_state); -@@ -1743,12 +1768,12 @@ +@@ -1743,12 +1763,12 @@ DEBUGMSG(("mibII/ipv6", " %d\n", exact)); #if 1 /* this is very odd but sometimes happen, and cause infinite loop */ @@ -540,7 +535,7 @@ savnameLen = j; memcpy(savname, newname, j * sizeof(oid)); found++; -@@ -1759,7 +1784,7 @@ +@@ -1759,7 +1779,7 @@ */ if ((savnameLen == 0) || (snmp_oid_compare(savname, savnameLen, newname, j) > 0)) { @@ -549,7 +544,7 @@ savnameLen = j; memcpy(savname, newname, j * sizeof(oid)); found++; -@@ -1767,15 +1792,15 @@ +@@ -1767,15 +1787,15 @@ } skip: @@ -570,7 +565,7 @@ free(sysctl_buf); #endif DEBUGMSGTL(("mibII/ipv6", "found=%d\n", found)); -@@ -1783,7 +1808,7 @@ +@@ -1783,7 +1803,7 @@ return NULL; *length = savnameLen; memcpy((char *) name, (char *) savname, *length * sizeof(oid)); @@ -579,7 +574,7 @@ *write_method = 0; *var_len = sizeof(long); /* default to 'long' results */ -@@ -1796,20 +1821,20 @@ +@@ -1796,20 +1816,20 @@ switch (vp->magic) { case IPV6TCPLOCALADDR: *var_len = sizeof(struct in6_addr); @@ -601,8 +596,8 @@ - if (IN6_IS_ADDR_LINKLOCAL(&in6pcb.in6p_laddr)) + if (IN6_IS_ADDR_LINKLOCAL(&savpcb.in6p_laddr)) long_return = -- ntohs(*(u_int16_t *) & in6pcb.in6p_laddr.s6_addr[2]); -+ ntohs(*(u_int16_t *) & savpcb.in6p_laddr.s6_addr[2]); +- ntohs(*(uint16_t *) & in6pcb.in6p_laddr.s6_addr[2]); ++ ntohs(*(uint16_t *) & savpcb.in6p_laddr.s6_addr[2]); else long_return = 0; /*XXX*/ return (u_char *) & long_return; |