From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21446 invoked by alias); 3 Apr 2003 13:32:59 -0000 Mailing-List: contact ecos-discuss-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@sources.redhat.com Received: (qmail 21439 invoked from network); 3 Apr 2003 13:32:59 -0000 Received: from unknown (HELO NTEX.tt.dk) (212.130.55.83) by sources.redhat.com with SMTP; 3 Apr 2003 13:32:59 -0000 Received: by ntex.tt.dk with Internet Mail Service (5.5.2653.19) id ; Thu, 3 Apr 2003 15:32:58 +0200 Message-ID: From: "Niels Beier (NB)" To: "'ecos-discuss@sources.redhat.com'" Date: Thu, 03 Apr 2003 13:32:00 -0000 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Subject: [ECOS] Possible problem in timeout.c X-SW-Source: 2003-04/txt/msg00078.txt.bz2 I think I have found a bug in /net/bsd_tcpip/current/src/ecos/timeout.c - Trunk 2.0 version - last CVS update 25 marts-2003 (I have discovered the problem as tcp_slowtimo in bsd_tcpip is never called) It seems only to be possible to create a single callout. In the timeout() function the following code may have a problem: stamp = 0; // Assume no slots available for (e = _timeouts; e; e = e->next) { if ((e->flags & CALLOUT_PENDING) == 0) { // Free entry callout_init(e); e->flags = CALLOUT_LOCAL; callout_reset(e, delta, fun, arg); stamp = (cyg_uint32)e; break; } } When the first callot is inserted, the callout_reset() functions sets the "next" field in the first element of the _timeouts array to zero (as timeous is initially equal to zero) and the second call to timeout() will fail. The "for loop" should be changed to something like this: for (i = 0; i < NTIMEOUTS; i++) { e = &_timeouts[i]; if ((e->flags & CALLOUT_PENDING) == 0) { // Free entry callout_init(e); e->flags = CALLOUT_LOCAL; callout_reset(e, delta, fun, arg); stamp = (cyg_uint32)e; break; } } Is there something, that I have misses? Best regards Niels Beier Thrane&Thrane A/S -- Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos and search the list archive: http://sources.redhat.com/ml/ecos-discuss