All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Jan Engelhardt <jengelh@medozas.de>
Cc: Netfilter Developer Mailing List
	<netfilter-devel@vger.kernel.org>,
	Linux Networking Developer Mailing List <netdev@vger.kernel.org>
Subject: Re: genetlink misinterprets NEW as GET
Date: Thu, 06 Jan 2011 15:55:09 +0100	[thread overview]
Message-ID: <4D25D7CD.6070006@netfilter.org> (raw)
In-Reply-To: <alpine.LNX.2.01.1101061508550.13211@obet.zrqbmnf.qr>

On 06/01/11 15:25, Jan Engelhardt wrote:
> On Thursday 2011-01-06 14:48, Pablo Neira Ayuso wrote:
>>>
>>> 	/* Modifiers to GET request */
>>> 	#define NLM_F_ROOT      0x100
>>> 	#define NLM_F_MATCH     0x200
>>> 	#define NLM_F_ATOMIC    0x400
>>> 	#define NLM_F_DUMP      (NLM_F_ROOT|NLM_F_MATCH)
>>> 	
>>> 	/* Modifiers to NEW request */
>>> 	#define NLM_F_REPLACE   0x100
>>> 	#define NLM_F_EXCL      0x200
>>> 	#define NLM_F_CREATE    0x400
>>> 	#define NLM_F_APPEND    0x800
>>>
>>> Except there is nothing that declares a particular Netlink message
>>> as "GET" or "NEW". Subsequently, genetlink chokes:
>>>
>>> 	if (nlh->nlmsg_flags & NLM_F_DUMP)
>>> 		if (ops->dumpit == NULL)
>>> 			return -EOPNOTSUPP;
>>>
>>> Because NLM_F_CREATE | NLM_F_EXCL == NLM_F_DUMP.
>>> That, of course, is absolutely bogus.
>>
>> Hm, NLM_F_CREATE | NLM_F_EXCL is not equal to NLM_F_DUMP.
>>
>> You must be hitting -EOPNOTSUPP elsewhere.
> 
> No, I am hitting EOPNOTSUPP here; right it's not equal, sorry.
> But nlmsg_flags is tested for NLM_F_MATCH (0x200), which is provided by
> NLM_F_EXCL. ipset does use NLM_F_EXCL and thus ran into this.

i getting confused, so ipset is also setting NLM_F_REPLACE to match the
NLM_F_DUMP bitmask?

  reply	other threads:[~2011-01-06 14:55 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-04  2:14 genetlink misinterprets NEW as GET Jan Engelhardt
2011-01-06 13:48 ` Pablo Neira Ayuso
2011-01-06 14:25   ` Jan Engelhardt
2011-01-06 14:55     ` Pablo Neira Ayuso [this message]
2011-01-06 16:12       ` Jan Engelhardt
2011-01-06 17:23   ` Ben Pfaff
2011-01-07  1:31     ` Pablo Neira Ayuso
2011-01-07  9:38       ` Jan Engelhardt
2011-01-07 12:12         ` Pablo Neira Ayuso
2011-01-07 13:15       ` [patch] " Jan Engelhardt
2011-01-07 13:33         ` Pablo Neira Ayuso
2011-01-10  0:25           ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4D25D7CD.6070006@netfilter.org \
    --to=pablo@netfilter.org \
    --cc=jengelh@medozas.de \
    --cc=netdev@vger.kernel.org \
    --cc=netfilter-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.