FYI: decoding netlink-generic

Masatake YAMATO yamato at redhat.com
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 https://github.com/masatake/strace/tree/openvswitch.

b3efc1419a3535cc608ce8c82fed0008922ef566
7b881ad3a4bffaf806ae5f8993904d0f09494ae9
c23fb09f88744b3058b03f56b2abf3fac09843bf
1448b3d4d7f954e6f6ad897b8d3e6a0f0ae47906
2a89942ba61d97beec2f324c072dd49471c75cc2

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