Lines 1332-1338
Link Here
|
1332 |
j = (int) vp->namelen; |
1332 |
j = (int) vp->namelen; |
1333 |
for (i = 0; i < sizeof(struct in6_addr); i++) |
1333 |
for (i = 0; i < sizeof(struct in6_addr); i++) |
1334 |
newname[j++] = tstpcb.in6p_laddr.s6_addr[i]; |
1334 |
newname[j++] = tstpcb.in6p_laddr.s6_addr[i]; |
1335 |
newname[j++] = ntohs(tstpcb.in6p_lport); |
1335 |
newname[j++] = ntohs(tstpcb.inp_lport); |
1336 |
if (IN6_IS_ADDR_LINKLOCAL(&tstpcb.in6p_laddr)) |
1336 |
if (IN6_IS_ADDR_LINKLOCAL(&tstpcb.in6p_laddr)) |
1337 |
newname[j++] = |
1337 |
newname[j++] = |
1338 |
ntohs(*(uint16_t *) & tstpcb.in6p_laddr.s6_addr[2]); |
1338 |
ntohs(*(uint16_t *) & tstpcb.in6p_laddr.s6_addr[2]); |
Lines 1396-1402
Link Here
|
1396 |
*var_len = sizeof(struct in6_addr); |
1396 |
*var_len = sizeof(struct in6_addr); |
1397 |
return savpcb.in6p_laddr.s6_addr; |
1397 |
return savpcb.in6p_laddr.s6_addr; |
1398 |
case IPV6UDPLOCALPORT: |
1398 |
case IPV6UDPLOCALPORT: |
1399 |
long_return = ntohs(savpcb.in6p_lport); |
1399 |
long_return = ntohs(savpcb.inp_lport); |
1400 |
return (u_char *) & long_return; |
1400 |
return (u_char *) & long_return; |
1401 |
case IPV6UDPIFINDEX: |
1401 |
case IPV6UDPIFINDEX: |
1402 |
if (IN6_IS_ADDR_LINKLOCAL(&savpcb.in6p_laddr)) |
1402 |
if (IN6_IS_ADDR_LINKLOCAL(&savpcb.in6p_laddr)) |
Lines 1519-1537
Link Here
|
1519 |
if (0 == (tstpcb.inp_vflag & INP_IPV6)) |
1519 |
if (0 == (tstpcb.inp_vflag & INP_IPV6)) |
1520 |
goto skip; |
1520 |
goto skip; |
1521 |
#endif |
1521 |
#endif |
1522 |
if (!NETSNMP_KLOOKUP(tstpcb.in6p_ppcb, (char *) &tcp6cb, sizeof(tcp6cb))) { |
1522 |
if (!NETSNMP_KLOOKUP(tstpcb.inp_ppcb, (char *) &tcp6cb, sizeof(tcp6cb))) { |
1523 |
DEBUGMSGTL(("mibII/ipv6", "klookup fail for tcb6.tcp6cb at %x\n", |
1523 |
DEBUGMSGTL(("mibII/ipv6", "klookup fail for tcb6.tcp6cb at %x\n", |
1524 |
tstpcb.in6p_ppcb)); |
1524 |
tstpcb.inp_ppcb)); |
1525 |
found = 0; |
1525 |
found = 0; |
1526 |
break; |
1526 |
break; |
1527 |
} |
1527 |
} |
1528 |
j = (int) vp->namelen; |
1528 |
j = (int) vp->namelen; |
1529 |
for (i = 0; i < sizeof(struct in6_addr); i++) |
1529 |
for (i = 0; i < sizeof(struct in6_addr); i++) |
1530 |
newname[j++] = tstpcb.in6p_laddr.s6_addr[i]; |
1530 |
newname[j++] = tstpcb.in6p_laddr.s6_addr[i]; |
1531 |
newname[j++] = ntohs(tstpcb.in6p_lport); |
1531 |
newname[j++] = ntohs(tstpcb.inp_lport); |
1532 |
for (i = 0; i < sizeof(struct in6_addr); i++) |
1532 |
for (i = 0; i < sizeof(struct in6_addr); i++) |
1533 |
newname[j++] = tstpcb.in6p_faddr.s6_addr[i]; |
1533 |
newname[j++] = tstpcb.in6p_faddr.s6_addr[i]; |
1534 |
newname[j++] = ntohs(tstpcb.in6p_fport); |
1534 |
newname[j++] = ntohs(tstpcb.inp_fport); |
1535 |
if (IN6_IS_ADDR_LINKLOCAL(&tstpcb.in6p_laddr)) |
1535 |
if (IN6_IS_ADDR_LINKLOCAL(&tstpcb.in6p_laddr)) |
1536 |
newname[j++] = |
1536 |
newname[j++] = |
1537 |
ntohs(*(uint16_t *) & tstpcb.in6p_laddr.s6_addr[2]); |
1537 |
ntohs(*(uint16_t *) & tstpcb.in6p_laddr.s6_addr[2]); |
Lines 1545-1551
Link Here
|
1545 |
DEBUGMSG(("mibII/ipv6", " %d\n", exact)); |
1545 |
DEBUGMSG(("mibII/ipv6", " %d\n", exact)); |
1546 |
|
1546 |
|
1547 |
#if 1 /* this is very odd but sometimes happen, and cause infinite loop */ |
1547 |
#if 1 /* this is very odd but sometimes happen, and cause infinite loop */ |
1548 |
if (ntohs(tstpcb.in6p_lport) == 0) |
1548 |
if (ntohs(tstpcb.inp_lport) == 0) |
1549 |
goto skip; |
1549 |
goto skip; |
1550 |
#endif |
1550 |
#endif |
1551 |
|
1551 |
|
Lines 1601-1613
Link Here
|
1601 |
*var_len = sizeof(struct in6_addr); |
1601 |
*var_len = sizeof(struct in6_addr); |
1602 |
return (u_char *) & savpcb.in6p_laddr.s6_addr[0]; |
1602 |
return (u_char *) & savpcb.in6p_laddr.s6_addr[0]; |
1603 |
case IPV6TCPLOCALPORT: |
1603 |
case IPV6TCPLOCALPORT: |
1604 |
long_return = ntohs(savpcb.in6p_lport); |
1604 |
long_return = ntohs(savpcb.inp_lport); |
1605 |
return (u_char *) & long_return; |
1605 |
return (u_char *) & long_return; |
1606 |
case IPV6TCPREMOTEADDR: |
1606 |
case IPV6TCPREMOTEADDR: |
1607 |
*var_len = sizeof(struct in6_addr); |
1607 |
*var_len = sizeof(struct in6_addr); |
1608 |
return (u_char *) & savpcb.in6p_faddr.s6_addr[0]; |
1608 |
return (u_char *) & savpcb.in6p_faddr.s6_addr[0]; |
1609 |
case IPV6TCPREMOTEPORT: |
1609 |
case IPV6TCPREMOTEPORT: |
1610 |
long_return = ntohs(savpcb.in6p_fport); |
1610 |
long_return = ntohs(savpcb.inp_fport); |
1611 |
return (u_char *) & long_return; |
1611 |
return (u_char *) & long_return; |
1612 |
case IPV6TCPIFINDEX: |
1612 |
case IPV6TCPIFINDEX: |
1613 |
if (IN6_IS_ADDR_LINKLOCAL(&savpcb.in6p_laddr)) |
1613 |
if (IN6_IS_ADDR_LINKLOCAL(&savpcb.in6p_laddr)) |
Lines 1742-1760
Link Here
|
1742 |
if (0 == (tstpcb.inp_vflag & INP_IPV6)) |
1742 |
if (0 == (tstpcb.inp_vflag & INP_IPV6)) |
1743 |
goto skip; |
1743 |
goto skip; |
1744 |
#endif |
1744 |
#endif |
1745 |
if (!NETSNMP_KLOOKUP(tstpcb.in6p_ppcb, (char *) &tcpcb, sizeof(tcpcb))) { |
1745 |
if (!NETSNMP_KLOOKUP(tstpcb.inp_ppcb, (char *) &tcpcb, sizeof(tcpcb))) { |
1746 |
DEBUGMSGTL(("mibII/ipv6", "klookup fail for tcb6.tcpcb at %x\n", |
1746 |
DEBUGMSGTL(("mibII/ipv6", "klookup fail for tcb6.tcpcb at %x\n", |
1747 |
tstpcb.in6p_ppcb)); |
1747 |
tstpcb.inp_ppcb)); |
1748 |
found = 0; |
1748 |
found = 0; |
1749 |
break; |
1749 |
break; |
1750 |
} |
1750 |
} |
1751 |
j = (int) vp->namelen; |
1751 |
j = (int) vp->namelen; |
1752 |
for (i = 0; i < sizeof(struct in6_addr); i++) |
1752 |
for (i = 0; i < sizeof(struct in6_addr); i++) |
1753 |
newname[j++] = tstpcb.in6p_laddr.s6_addr[i]; |
1753 |
newname[j++] = tstpcb.in6p_laddr.s6_addr[i]; |
1754 |
newname[j++] = ntohs(tstpcb.in6p_lport); |
1754 |
newname[j++] = ntohs(tstpcb.inp_lport); |
1755 |
for (i = 0; i < sizeof(struct in6_addr); i++) |
1755 |
for (i = 0; i < sizeof(struct in6_addr); i++) |
1756 |
newname[j++] = tstpcb.in6p_faddr.s6_addr[i]; |
1756 |
newname[j++] = tstpcb.in6p_faddr.s6_addr[i]; |
1757 |
newname[j++] = ntohs(tstpcb.in6p_fport); |
1757 |
newname[j++] = ntohs(tstpcb.inp_fport); |
1758 |
if (IN6_IS_ADDR_LINKLOCAL(&tstpcb.in6p_laddr)) |
1758 |
if (IN6_IS_ADDR_LINKLOCAL(&tstpcb.in6p_laddr)) |
1759 |
newname[j++] = |
1759 |
newname[j++] = |
1760 |
ntohs(*(uint16_t *) & tstpcb.in6p_laddr.s6_addr[2]); |
1760 |
ntohs(*(uint16_t *) & tstpcb.in6p_laddr.s6_addr[2]); |
Lines 1768-1774
Link Here
|
1768 |
DEBUGMSG(("mibII/ipv6", " %d\n", exact)); |
1768 |
DEBUGMSG(("mibII/ipv6", " %d\n", exact)); |
1769 |
|
1769 |
|
1770 |
#if 1 /* this is very odd but sometimes happen, and cause infinite loop */ |
1770 |
#if 1 /* this is very odd but sometimes happen, and cause infinite loop */ |
1771 |
if (ntohs(tstpcb.in6p_lport) == 0) |
1771 |
if (ntohs(tstpcb.inp_lport) == 0) |
1772 |
goto skip; |
1772 |
goto skip; |
1773 |
#endif |
1773 |
#endif |
1774 |
result = snmp_oid_compare(name, *length, newname, j); |
1774 |
result = snmp_oid_compare(name, *length, newname, j); |
Lines 1823-1835
Link Here
|
1823 |
*var_len = sizeof(struct in6_addr); |
1823 |
*var_len = sizeof(struct in6_addr); |
1824 |
return (u_char *) & savpcb.in6p_laddr.s6_addr[0]; |
1824 |
return (u_char *) & savpcb.in6p_laddr.s6_addr[0]; |
1825 |
case IPV6TCPLOCALPORT: |
1825 |
case IPV6TCPLOCALPORT: |
1826 |
long_return = ntohs(savpcb.in6p_lport); |
1826 |
long_return = ntohs(savpcb.inp_lport); |
1827 |
return (u_char *) & long_return; |
1827 |
return (u_char *) & long_return; |
1828 |
case IPV6TCPREMOTEADDR: |
1828 |
case IPV6TCPREMOTEADDR: |
1829 |
*var_len = sizeof(struct in6_addr); |
1829 |
*var_len = sizeof(struct in6_addr); |
1830 |
return (u_char *) & savpcb.in6p_faddr.s6_addr[0]; |
1830 |
return (u_char *) & savpcb.in6p_faddr.s6_addr[0]; |
1831 |
case IPV6TCPREMOTEPORT: |
1831 |
case IPV6TCPREMOTEPORT: |
1832 |
long_return = ntohs(savpcb.in6p_fport); |
1832 |
long_return = ntohs(savpcb.inp_fport); |
1833 |
return (u_char *) & long_return; |
1833 |
return (u_char *) & long_return; |
1834 |
case IPV6TCPIFINDEX: |
1834 |
case IPV6TCPIFINDEX: |
1835 |
if (IN6_IS_ADDR_LINKLOCAL(&savpcb.in6p_laddr)) |
1835 |
if (IN6_IS_ADDR_LINKLOCAL(&savpcb.in6p_laddr)) |