Author: mladen.turk(a)jboss.com
Date: 2007-09-09 05:36:15 -0400 (Sun, 09 Sep 2007)
New Revision: 994
Modified:
trunk/sight/native/os/windows/tcpstat.c
Log:
Fix garbage port for listening sockets
Modified: trunk/sight/native/os/windows/tcpstat.c
===================================================================
--- trunk/sight/native/os/windows/tcpstat.c 2007-09-09 09:20:58 UTC (rev 993)
+++ trunk/sight/native/os/windows/tcpstat.c 2007-09-09 09:36:15 UTC (rev 994)
@@ -390,10 +390,12 @@
strcpy(las, inet_ntoa(ial));
strcpy(ras, inet_ntoa(iar));
lp = ntohs((unsigned short)(0x0000FFFF &
e->p4->table[index].dwLocalPort));
- rp = ntohs((unsigned short)(0x0000FFFF &
e->p4->table[index].dwRemotePort));
+ rp = ntohs((unsigned short)(0x0000FFFF &
e->p4->table[index].dwRemotePort));
state = e->p4->table[index].dwState;
pid = e->p4->table[index].dwOwningPid;
cts = litime_to_ms(&(e->p4->table[index].liCreateTimestamp));
+ if (state == MIB_TCP_STATE_LISTEN &&
e->p4->table[index].dwRemoteAddr == 0)
+ rp = 0;
}
else if (e->type == 2) {
sight_inet_ntop6(e->p6->table[index].ucLocalAddr, las, 64);
@@ -411,6 +413,8 @@
state = e->p6->table[index].dwState;
pid = e->p6->table[index].dwOwningPid;
cts = litime_to_ms(&(e->p6->table[index].liCreateTimestamp));
+ if (state == MIB_TCP_STATE_LISTEN)
+ rp = 0;
}
sight_tcpconn_set_pid(_E, conn, pid);
sight_tcpconn_set_cts(_E, conn, cts);
Show replies by date