On Thu, Aug 01, 2013 at 02:37:10AM +0200, Pablo Neira Ayuso wrote: > On Wed, Jul 31, 2013 at 05:03:48PM -0700, David Miller wrote: [...] > > Therefore I don't see how NLM_F_REPLACE and NLM_F_EXCL can be used > > at all, in those places, because the check is still "& NLM_F_DUMP" > > The kind = type&3; is doing the magic there for rtnetlink. kind == 2 > means that this is a get command, and you can only set NLM_F_DUMP > using the get command. > > Since it doesn't make sense to use NLM_F_EXCL or NLM_F_REPLACE for get > commands, there is no room for ambiguity and rtnetlink is fine. I had re-read what I wrote to get your point. We can fix in a different way by checking for: ops->flags & GENL_CMD_CAP_DUMP, which means we have a .dumpit callback, so only in that case genetlink should interpret the flags as NLM_F_DUMP. Please, see patch attached.