Callback only called every second time
Tilman Bender
tilman.bender at rub.de
Mon Oct 19 09:45:13 PDT 2015
Dear libnl-List,
I have a weird issue where my callback to receive and parse the response
from my kernel module will only be triggered every second
request message I send.
I am pretty sure I have things set up wrong, but as there is not much
information in step-by-step tutorial format I could not find how to do
it right.
The attached log-file contains the logging output for code like this
testNetlink();
getWatchListSize();
getWatchListSize();
getWatchListSize();
getWatchListSize();
I hope you can point me to my mistake.
kind regards
Tilman
-------------- next part --------------
10-19 16:58:08.601 3843-3843/de.whatever.bender.myapp D/libnl3: DBG<1>: Registered cache operations genl/family
10-19 16:58:08.734 3843-3843/de.whatever.bender.myapp D/myapp: netlink socket allocated successfully. Port: 3843
10-19 16:58:08.734 3843-3843/de.whatever.bender.myapp D/myapp: netlink callback registered successfully
10-19 16:58:08.734 3843-3843/de.whatever.bender.myapp D/libnl3: DBG<2>: msg 0x5d49c420: Allocated new message, maxlen=4096
10-19 16:58:08.734 3843-3843/de.whatever.bender.myapp D/libnl3: DBG<2>: msg 0x5d49c420: Added netlink header type=16, flags=0, pid=0, seq=0
10-19 16:58:08.734 3843-3843/de.whatever.bender.myapp D/libnl3: DBG<2>: msg 0x5d49c420: Reserved 4 (4) bytes, pad=4, nlmsg_len=20
10-19 16:58:08.734 3843-3843/de.whatever.bender.myapp D/libnl3: DBG<2>: msg 0x5d49c420: Added generic netlink header cmd=3 version=1
10-19 16:58:08.734 3843-3843/de.whatever.bender.myapp D/libnl3: DBG<2>: msg 0x5d49c420: attr <0x41f73c84> 2: Reserved 16 (11) bytes at offset +4 nlmsg_len=36
10-19 16:58:08.734 3843-3843/de.whatever.bender.myapp D/libnl3: DBG<2>: msg 0x5d49c420: attr <0x41f73c84> 2: Wrote 11 bytes at offset +4
10-19 16:58:08.734 3843-3843/de.whatever.bender.myapp D/libnl3: DBG<2>: msg 0x5cdbc438: Allocated new message, maxlen=212
10-19 16:58:08.734 3843-3843/de.whatever.bender.myapp D/libnl3: DBG<2>: msg 0x5cdbc438: Freed
10-19 16:58:08.734 3843-3843/de.whatever.bender.myapp D/libnl3: DBG<2>: msg 0x5d1b4de0: Allocated new message, maxlen=36
10-19 16:58:08.734 3843-3843/de.whatever.bender.myapp D/libnl3: DBG<2>: msg 0x5d1b4de0: Freed
10-19 16:58:08.734 3843-3843/de.whatever.bender.myapp D/libnl3: DBG<2>: msg 0x5d49c420: Freed
10-19 16:58:08.734 3843-3843/de.whatever.bender.myapp D/myapp: Succes resolving netlink family. We can now send messages to the kernel.
10-19 16:58:08.734 3843-3843/de.whatever.bender.myapp D/libnl3: DBG<2>: msg 0x5d49c420: Allocated new message, maxlen=4096
10-19 16:58:08.734 3843-3843/de.whatever.bender.myapp D/libnl3: DBG<2>: msg 0x5d49c420: Allocated new simple message
10-19 16:58:08.734 3843-3843/de.whatever.bender.myapp D/libnl3: DBG<2>: msg 0x5d49c420: Reserved 4 (4) bytes, pad=4, nlmsg_len=20
10-19 16:58:08.734 3843-3843/de.whatever.bender.myapp D/libnl3: DBG<2>: msg 0x5d49c420: Appended 4 bytes with padding 4
10-19 16:58:08.734 3843-3843/de.whatever.bender.myapp D/libnl3: DBG<2>: msg 0x5d49c420: Freed
10-19 16:58:08.734 3843-3843/de.whatever.bender.myapp D/libnl3: DBG<2>: msg 0x5d49c420: Allocated new message, maxlen=28
10-19 16:58:08.734 3843-3843/de.whatever.bender.myapp D/myapp: Netlink callback called!
10-19 16:58:08.734 3843-3843/de.whatever.bender.myapp D/myapp: netlink message: len: 28 , type: 18, pid: 0
10-19 16:58:08.734 3843-3843/de.whatever.bender.myapp D/myapp: generic netlink message: cmd 4
10-19 16:58:08.734 3843-3843/de.whatever.bender.myapp D/myapp: This is a DIZ_MYFAMILY_C_GET_LEN_WATCHLIST message
10-19 16:58:08.734 3843-3843/de.whatever.bender.myapp D/myapp: Kernel reports watchlist size is: 1
10-19 16:58:08.734 3843-3843/de.whatever.bender.myapp D/libnl3: DBG<2>: msg 0x5d49c420: Freed
10-19 16:58:08.734 3843-3843/de.whatever.bender.myapp D/myapp: netlink: retrieving length of watchlist
10-19 16:58:08.734 3843-3843/de.whatever.bender.myapp D/libnl3: DBG<2>: msg 0x5d49c420: Allocated new message, maxlen=4096
10-19 16:58:08.734 3843-3843/de.whatever.bender.myapp D/libnl3: DBG<2>: msg 0x5d49c420: Added netlink header type=18, flags=1, pid=0, seq=0
10-19 16:58:08.734 3843-3843/de.whatever.bender.myapp D/libnl3: DBG<2>: msg 0x5d49c420: Reserved 4 (4) bytes, pad=4, nlmsg_len=20
10-19 16:58:08.734 3843-3843/de.whatever.bender.myapp D/libnl3: DBG<2>: msg 0x5d49c420: Added generic netlink header cmd=4 version=1
10-19 16:58:08.734 3843-3843/de.whatever.bender.myapp D/myapp: Sending netlink DIZ_MYFAMILY_C_GET_LEN_WATCHLIST message succeded!
10-19 16:58:08.734 3843-3843/de.whatever.bender.myapp D/libnl3: DBG<2>: msg 0x5cdbc438: Allocated new message, maxlen=36
10-19 16:58:08.734 3843-3843/de.whatever.bender.myapp D/libnl3: DBG<2>: msg 0x5cdbc438: Freed
10-19 16:58:08.734 3843-3843/de.whatever.bender.myapp D/myapp: netlink: retrieving length of watchlist
10-19 16:58:08.734 3843-3843/de.whatever.bender.myapp D/libnl3: DBG<2>: msg 0x5cdbc438: Allocated new message, maxlen=4096
10-19 16:58:08.734 3843-3843/de.whatever.bender.myapp D/libnl3: DBG<2>: msg 0x5cdbc438: Added netlink header type=18, flags=1, pid=0, seq=0
10-19 16:58:08.734 3843-3843/de.whatever.bender.myapp D/libnl3: DBG<2>: msg 0x5cdbc438: Reserved 4 (4) bytes, pad=4, nlmsg_len=20
10-19 16:58:08.734 3843-3843/de.whatever.bender.myapp D/libnl3: DBG<2>: msg 0x5cdbc438: Added generic netlink header cmd=4 version=1
10-19 16:58:08.734 3843-3843/de.whatever.bender.myapp D/myapp: Sending netlink DIZ_MYFAMILY_C_GET_LEN_WATCHLIST message succeded!
10-19 16:58:08.734 3843-3843/de.whatever.bender.myapp D/libnl3: DBG<2>: msg 0x5d7eda50: Allocated new message, maxlen=28
10-19 16:58:08.734 3843-3843/de.whatever.bender.myapp D/myapp: Netlink callback called!
10-19 16:58:08.734 3843-3843/de.whatever.bender.myapp D/myapp: netlink message: len: 28 , type: 18, pid: 0
10-19 16:58:08.734 3843-3843/de.whatever.bender.myapp D/myapp: generic netlink message: cmd 4
10-19 16:58:08.734 3843-3843/de.whatever.bender.myapp D/myapp: This is a DIZ_MYFAMILY_C_GET_LEN_WATCHLIST message
10-19 16:58:08.734 3843-3843/de.whatever.bender.myapp D/myapp: Kernel reports watchlist size is: 1
10-19 16:58:08.734 3843-3843/de.whatever.bender.myapp D/libnl3: DBG<2>: msg 0x5d7eda50: Freed
10-19 16:58:08.734 3843-3843/de.whatever.bender.myapp D/myapp: netlink: retrieving length of watchlist
10-19 16:58:08.734 3843-3843/de.whatever.bender.myapp D/libnl3: DBG<2>: msg 0x5d7eda50: Allocated new message, maxlen=4096
10-19 16:58:08.734 3843-3843/de.whatever.bender.myapp D/libnl3: DBG<2>: msg 0x5d7eda50: Added netlink header type=18, flags=1, pid=0, seq=0
10-19 16:58:08.734 3843-3843/de.whatever.bender.myapp D/libnl3: DBG<2>: msg 0x5d7eda50: Reserved 4 (4) bytes, pad=4, nlmsg_len=20
10-19 16:58:08.734 3843-3843/de.whatever.bender.myapp D/libnl3: DBG<2>: msg 0x5d7eda50: Added generic netlink header cmd=4 version=1
10-19 16:58:08.734 3843-3843/de.whatever.bender.myapp D/myapp: Sending netlink DIZ_MYFAMILY_C_GET_LEN_WATCHLIST message succeded!
10-19 16:58:08.734 3843-3843/de.whatever.bender.myapp D/libnl3: DBG<2>: msg 0x5c99a898: Allocated new message, maxlen=36
10-19 16:58:08.734 3843-3843/de.whatever.bender.myapp D/libnl3: DBG<2>: msg 0x5c99a898: Freed
10-19 16:58:08.734 3843-3843/de.whatever.bender.myapp D/myapp: netlink: retrieving length of watchlist
10-19 16:58:08.734 3843-3843/de.whatever.bender.myapp D/libnl3: DBG<2>: msg 0x5c99a898: Allocated new message, maxlen=4096
10-19 16:58:08.734 3843-3843/de.whatever.bender.myapp D/libnl3: DBG<2>: msg 0x5c99a898: Added netlink header type=18, flags=1, pid=0, seq=0
10-19 16:58:08.734 3843-3843/de.whatever.bender.myapp D/libnl3: DBG<2>: msg 0x5c99a898: Reserved 4 (4) bytes, pad=4, nlmsg_len=20
10-19 16:58:08.734 3843-3843/de.whatever.bender.myapp D/libnl3: DBG<2>: msg 0x5c99a898: Added generic netlink header cmd=4 version=1
10-19 16:58:08.734 3843-3843/de.whatever.bender.myapp D/myapp: Sending netlink DIZ_MYFAMILY_C_GET_LEN_WATCHLIST message succeded!
10-19 16:58:08.734 3843-3843/de.whatever.bender.myapp D/libnl3: DBG<2>: msg 0x5c6fde88: Allocated new message, maxlen=28
10-19 16:58:08.734 3843-3843/de.whatever.bender.myapp D/myapp: Netlink callback called!
10-19 16:58:08.734 3843-3843/de.whatever.bender.myapp D/myapp: netlink message: len: 28 , type: 18, pid: 0
10-19 16:58:08.734 3843-3843/de.whatever.bender.myapp D/myapp: generic netlink message: cmd 4
10-19 16:58:08.734 3843-3843/de.whatever.bender.myapp D/myapp: This is a DIZ_MYFAMILY_C_GET_LEN_WATCHLIST message
10-19 16:58:08.734 3843-3843/de.whatever.bender.myapp D/myapp: Kernel reports watchlist size is: 1
10-19 16:58:08.734 3843-3843/de.whatever.bender.myapp D/libnl3: DBG<2>: msg 0x5c6fde88: Free
-------------- next part --------------
A non-text attachment was scrubbed...
Name: netlink_snippet.c
Type: text/x-csrc
Size: 4651 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/libnl/attachments/20151019/569d683a/attachment.bin>
More information about the libnl
mailing list