From 76d449ebe6681a59d83c9dcec330c50c16daa72d Mon Sep 17 00:00:00 2001 From: Stefan Kalkowski Date: Thu, 11 Jul 2013 14:44:45 +0200 Subject: [PATCH] Start receiver thread in LwIP after initialization Otherwise the receiver thread might access variables not initialized properly, and thereby raising pagefaults. Fixes #802 --- libports/src/lib/lwip/platform/nic.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libports/src/lib/lwip/platform/nic.cc b/libports/src/lib/lwip/platform/nic.cc index 7783710801..027232ac93 100644 --- a/libports/src/lib/lwip/platform/nic.cc +++ b/libports/src/lib/lwip/platform/nic.cc @@ -263,7 +263,6 @@ extern "C" { /* Setup receiver thread */ Nic_receiver_thread *th = new (env()->heap()) Nic_receiver_thread(nic, netif); - th->start(); /* Store receiver thread address in user-defined netif struct part */ netif->state = (void*) th; @@ -285,6 +284,8 @@ extern "C" { for(int i=0; i<6; ++i) netif->hwaddr[i] = _mac.addr[i]; + th->start(); + return ERR_OK; } } /* extern "C" */