Skip to contentSkip to conversation

Missing use of TcpPassiveOpens counter?

PATCH Johan Adolfsson 1 participant 1 message Mar 12, 2001

lore
Share & tools
lore
#0 lore raw

While trying to track down a possible select()/accept() problem in 2.0.38 I noticed that theTcpPassiveOpens counter is never increased (not in 2.0, 2.2 nor 2.4)

When checking more of the Tcp: fields in /proc/net/snmp
it looks like some more fields are not set correctly (tcpRto*, tcpMaxConn )

Just overlooked and forgotten or does nobody care? (or both:)

The following patch for 2.0 increases the TcpPassiveOpen counter, the case where you have crossed SYN's is not handled, but I don't think it should anyway?
At first I was tempted to put it in the tcp_accept() function, but it should really be when we change state from LISTEN to SYN_RECVD.

03/12 12:11:18 renamed from 03/30 15:53:22 1.7 +3 -1
diff -u -p -r1.7 tcp_input.c
@@ -747,7 +747,9 @@ static void tcp_conn_request(struct sock
        newsk->dummy_th.source = skb->h.th->dest;
        newsk->dummy_th.dest = skb->h.th->source;
        newsk->users=0;
-
+
+      tcp_statistics.TcpPassiveOpens++; /* LISTEN to SYN_RECV */
+
 #ifdef CONFIG_IP_TRANSPARENT_PROXY
        /* 
         *      Deal with possibly redirected traffic by setting num to

In 2.4 I'm not sure where to put the
TCP_INC_STATS(TcpPassiveOpens); or
TCP_INC_STATS_BH(TcpPassiveOpens);

tcp_minisocks.c:tcp_create_openreq_child() ?

/Johan