FYI: decoding netlink-generic

Masatake YAMATO yamato at
Fri Mar 25 14:16:10 UTC 2022

In my daily job, I'm going to implement decoders for the
netlink communication between openvswitch.ko and vswitchd.

The communication of "openvswitch" is stacked on netlink-generic.
As preparation and studying, I decoded "nlctrl" partially.
The communication of "nlctrl" is also stacked on netlink-generic.
I pushed the decoder for "nlctrl" to


I would like to finish the decoder for "nlctrl" and submit it here.
However, till I finish the daily job in the end of this April, I don't have time
for submitting the result.

If you are internal in decoding netlink-generic, feel free to
cheery-pick the changes in my branch to your decoding project.

With strace -- version 5.16

    [yamato at dev64]~/usr/lectures/kernel_intro5% strace -e sendto genl ctrl list > /dev/null             
    sendto(3, [{nlmsg_len=20, nlmsg_type=nlctrl, nlmsg_flags=NLM_F_REQUEST|0x300, nlmsg_seq=1648105166, nlmsg_pid=0}, \
                "\x03\x00\x00\x00"], 20, 0, NULL, 0) = 20
    +++ exited with 0 +++

With strace with changes in the branch

    [yamato at dev64]~/usr/lectures/kernel_intro5% ~/var/strace/src/strace -e sendto genl ctrl list > /dev/null
    sendto(3, [{nlmsg_len=20, nlmsg_type=nlctrl, nlmsg_flags=NLM_F_REQUEST|NLM_F_DUMP, nlmsg_seq=1648105113, nlmsg_pid=0}, \
               {cmd=CTRL_CMD_GETFAMILY, version=0, reserved=0}], 20, 0, NULL, 0) = 20
    +++ exited with 0 +++

Masatake YAMATO

More information about the Strace-devel mailing list