> During a quick scan through the lwip code, I couldn't find the same situation again: every time
> SYS_ARCH_PROTECT() / SYS_ARCH_UNPROTECT() is called there is only plain vanilla code in-between
> (i.e.: no calls to RTOS functions) which strongs my belief that this *really* is a bug inside sockets.c only!
That would mainly be because the core code doesn't use threads and the socket layer is one of the only files using multithreading.
I think I remember that we had a bug exactly along these lines some time, so I'm not at all enthusiastic about changing it again. I suggest having a look in the file's history if it wasn't as you suggested.
Anyway, the fix is easy: just block your scheduler in SYS_ARCH_UNPROTECT(). I'll stick to "it's a bug in the FreeRTOS/lwIP port", even if it triggers nowhere else :-)
Simon