You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Though the document of kernel (https://kernel.org/doc/html/next/userspace-api/netlink/intro.html#netlink-message-types)
specify the format of netlink message with NLMSG_DONE, it also says that "Note that some implementations may issue custom NLMSG_DONE messages in reply to do action requests.
In that case the payload is implementation-specific and may also be absent.".
After searching the source code of kernel, we can find that
1. the format specified in the document is obeyed by most generic
netlink but some generic netlink like this (https://elixir.bootlin.com/linux/v6.15/source/drivers/net/team/team_core.c#L2494) has no payload,
so as a generic lib, we should not suppose the format of DoneMessage.
it's sensible to just save the payload.
2. when use NLMSG_DONE as an end of multi messages, there will always be
a NLM_F_MULTIPART in the flag and only in this case should we parse it
as a DoneMessage, in other occassion like connector netlink
(https://elixir.bootlin.com/linux/v6.15/source/drivers/connector/connector.c#L101),
we should parse it as a common message.
Signed-off-by: feng zhao <[email protected]>
0 commit comments