lwip-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-devel] [bug #22983] Bugs in unix port unixsim program


From: Rishi Khan
Subject: [lwip-devel] [bug #22983] Bugs in unix port unixsim program
Date: Sun, 04 May 2008 23:04:03 +0000
User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14

Follow-up Comment #3, bug #22983 (project lwip):

I am using 1.3.0:

1) You would think so. However, if I add the following at line 323 of
memp.c:
   
printf("type=%d,used=%d,max=%d,avail=%dn",type,lwip_stats.memp[type].used,lwip_stats.memp[type].max,lwip_stats.memp[type].avail);
printf("systimeouts=%d, needed =%dn", MEMP_NUM_SYS_TIMEOUT, LWIP_TCP +
IP_REASSEMBLY + LWIP_ARP + (2*LWIP_DHCP) + LWIP_AUTOIP + LWIP_IGMP + LWIP_DNS
+ PPP_SUPPORT);

I get this (using the proper greps):
systimeouts=10, needed =3
and before a telnet to port 23:
type=11,used=3,max=3,avail=10
and after:
type=11,used=4,max=4,avail=10
(note, this already includes my increase from 3 to 10) ... I was incorrect in
my original bug post .. it was 3, not 2.

After trapping in memp.c and looking where the calls are made from here are
the results:
tcpip.c:239 (tcpip_thread if IP_REASSEMBLY)
tcpip.c:242 (tcp_timer_needed if LWIP_ARP)
tapif.c:353 (tapif_init .. for an arp_timer)
tcpip.c:106 (tcp_timer_needed if LWIP_TCP)

So my guess is that the tapif.c timeout is the problem. It seems that the
arp_timer is superflous because tcpip.c:242 makes the same call. If you remove
this tapif sys_timeout, the program seems to work fine.

In fact, it would seem that the program shouldn't even compile (because of
the naming conflict) except for the saving grace of the 'static' function
declaration.

So, I offer a better fix: Remove the sys_timeout in tapif.c on line 352.


2) The bug is that the variables that the printf points to are NULL. One easy
fix is to make this "" instead of NULL. However, it would probably be better
to rewrite this as a stat_display() call.


    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/bugs/?22983>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]