This is the mail archive of the ecos-patches@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: lwIP update to version 1.1.1 Part 2


On Mon, Mar 27, 2006 at 08:09:48AM +0200, uwe.kindler@cetoni.de wrote:
> Hello,
> 
> the attached patch updates the complete lwip source to the lwIP
> version 1.1.1 from lwIP CVS and fixes some minor issues. The lwIP
> tests have been rewritten to make them applicable depending on lwip
> configuration.

Hi Uwe

I've got a few problems with the ethernet code. 

1) The dhcp code deadlocks. I tracked this down. 
static void
ecosglue_init(void)
{
    etharp_init();
    cyg_semaphore_init(&delivery, 0);
    init_hw_drivers();
    sys_thread_new(input_thread, (void*)0, CYGNUM_LWIP_ETH_THREAD_PRIORITY);
}

init_hw_drivers() calls into the dhcp code. It does not exist until
dhcp negotiation is complete. However in order to complete it needs to
be able to receiver packets and to do that it needs the input_thread
started. I fixed the problem by starting the input_thread before
calling init_hw_drivers(), but im not really sure that dhcp should be
started where it currently is.

The second problem i have is double answers to pings. It looks like
this hunk in the patch is wrong and causes packets to be sent out
twice. There is some recursion going on. I've not yet fully understood
the problem. I will investigate more.

@@ -277,13 +281,14 @@
 static err_t
 ecosif_output(struct netif *netif, struct pbuf *p, struct ip_addr *ipaddr)
 {
-
-  p = etharp_output(netif, ipaddr, p);
-  if (p) {
-    low_level_output(netif, p);
+  err_t result;
+  result = etharp_output(netif, ipaddr, p);
+  if (ERR_OK == result) 
+  {
+    result = low_level_output(netif, p);
     p = NULL;
   }
-  return ERR_OK;
+  return result;
 }

        Andrew


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]