• D
    netlink: Add answer_flags to netlink_callback · 22e6c58b
    David Ahern 提交于
    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: NDavid Ahern <dsahern@gmail.com>
    Signed-off-by: NDavid S. Miller <davem@davemloft.net>
    22e6c58b
netlink.h 6.9 KB