Sequence number mismatch
Arend van Spriel
arend at broadcom.com
Mon Sep 30 04:25:51 EDT 2013
On 09/08/2013 02:04 AM, Teto wrote:
> Hi,
>
> Ok I found the problem. I had changed some parameters because my
> daemon would only answer the first time it recieved a request. I've
> reset all sequence number to 0 and disabled seq checks and had a look
> at the python binding though I was not that enthusiast ^^''' .
> I added some pynl_debug to check what was going on ( btw the pynl_dbg
> macro is not portable and doesn't work if you have no additionnal
> arguments, a portable with 0 or more varargs is doable like this
> https://github.com/teto/lispmob/blob/forwarding/lispd/lispd_log.h ).
>
> When checking the callback return value in capi.i:nl_recv_msg_handler,
> the code used PyArg_ParseTuple which only works with tuples or so it
> seems: http://stackoverflow.com/questions/13636711/what-is-the-proper-usage-of-pyarg-parsetuple
> So the daemon would answer the first request but then
> :nl_recv_msg_handler could not parse the return value and would return
> NL_STOP, thus preventing from answering other requests. Once you
> replace PyArg_ParseTuple with PyLong_AsLong it works fine.
Thanks for digging into this. I submitted a patch for this:
[PATCH] python: remove use of PyArg_ParseTuple() for callback result
It still does a NL_STOP if the python callback does not return a PyInt
object. Preferably, I would raise an exception, but not sure how to
accomplish that.
Regards,
Arend
More information about the libnl
mailing list