[RTnet-developers] stack/packet/af_packet.c hint
Brought to you by:
bet-frogger,
kiszka
|
From: Wolfgang <wk...@ko...> - 2007-11-08 11:50:37
|
Hello, I regularly get an assertion in rtnet-0.9.9/stack/packet/af_packet.c function rt_packet_recvmsg(), line 302. The relevant code is: > rtskb = rtskb_dequeue_chain(&sock->incoming); > RTNET_ASSERT(rtskb != NULL, return -EFAULT;); The assertion is: > kernel: [ 273.609588] Assertion failed! .../rtnet-0.9.9/stack/packet/ > af_packet.c:rt_packet_recvmsg:302 rtskb != NULL AFAICS this seems to happen for every nonblocking recv with no data available. This is not a problem unless you call it frequently and the error message starts to take up lots of CPU time (and disk space). For my application, the error message crashed the system. Workaround (patch attached): > rtskb = rtskb_dequeue_chain(&sock->incoming); > if (rtskb == NULL && timeout < 0) > return -EWOULDBLOCK; /* workaround to avoid assertion for > nonblocking recv. with no data avail. */ > RTNET_ASSERT(rtskb != NULL, return -EFAULT;); I do not know if this is a bad workaround or proper solution. It works for me, though. SVN has not changed compared to rtnet-0.9.9 at this piece of code. Bye, Wolfgang |