Author: mladen.turk(a)jboss.com
Date: 2007-09-10 03:21:38 -0400 (Mon, 10 Sep 2007)
New Revision: 1007
Modified:
trunk/sight/native/os/linux/udpstat.c
Log:
Smarter UDP connection state detection
Modified: trunk/sight/native/os/linux/udpstat.c
===================================================================
--- trunk/sight/native/os/linux/udpstat.c 2007-09-10 07:16:42 UTC (rev 1006)
+++ trunk/sight/native/os/linux/udpstat.c 2007-09-10 07:21:38 UTC (rev 1007)
@@ -236,8 +236,8 @@
unsigned long rxq, txq, timelen, retr, inode;
int num, d, uid, timer_run, timeout;
char more[512];
+ int laddr = 0;
-
udpconn_enum_t *e = J2P(handle, udpconn_enum_t *);
if (!e || !e->tnet)
@@ -268,6 +268,8 @@
inet_ntop(AF_INET, &in4, ras, 64);
else
ras[0] = '\0';
+ if (in4.s_addr == 0 && rp == 0);
+ laddr = 1;
}
else {
/* IPV6 entries */
@@ -290,6 +292,10 @@
sight_inet_ntop6(in6.s6_addr, ras, 64);
else
ras[0] = '\0';
+ if (in6.s6_addr32[0] == 0 && in6.s6_addr32[1] == 0 &&
+ in6.s6_addr32[2] == 0 && in6.s6_addr32[3] == 0 &&
+ rp == 0)
+ laddr = 1;
}
/* TODO: See what's the actual value of timelen */
tmo = timelen;
@@ -301,10 +307,13 @@
switch (state) {
case TCP_ESTABLISHED:
- sight_tcpconn_set_state(_E, conn, 1);
+ sight_tcpconn_set_state(_E, conn, 2);
break;
+ case TCP_CLOSE:
+ sight_tcpconn_set_state(_E, conn, 3);
+ break;
default:
- sight_tcpconn_set_state(_E, conn, 0);
+ sight_tcpconn_set_state(_E, conn, laddr);
break;
}
Show replies by date