]> git.baikalelectronics.ru Git - kernel.git/commit
netlink: Add answer_flags to netlink_callback
authorDavid Ahern <dsahern@gmail.com>
Tue, 16 Oct 2018 01:56:41 +0000 (18:56 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 16 Oct 2018 07:13:12 +0000 (00:13 -0700)
commitdf450df764f72238a2f7c3405bc8de0dd8956e50
treefa691a44c7ad64e75741c16029074bb92f2cff0a
parent30aaee6ff5000c35de627b4785e4a5f6faa6bb99
netlink: Add answer_flags to netlink_callback

With dump filtering we need a way to ensure the NLM_F_DUMP_FILTERED
flag is set on a message back to the user if the data returned is
influenced by some input attributes. Normally this can be done as
messages are added to the skb, but if the filter results in no data
being returned, the user could be confused as to why.

This patch adds answer_flags to the netlink_callback allowing dump
handlers to set the NLM_F_DUMP_FILTERED at a minimum in the
NLMSG_DONE message ensuring the flag gets back to the user.

The netlink_callback space is initialized to 0 via a memset in
__netlink_dump_start, so init of the new answer_flags is covered.

Signed-off-by: David Ahern <dsahern@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/netlink.h
net/netlink/af_netlink.c