netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH ipset 1/2] lib: fix ifname 'physdev:' prefix parsing
@ 2014-02-12  9:27 Florian Westphal
  2014-02-12  9:27 ` [PATCH ipset 2/2] lib: don't segfault when ipset_data_get returns NULL Florian Westphal
  2014-02-13 10:10 ` [PATCH ipset 1/2] lib: fix ifname 'physdev:' prefix parsing Jozsef Kadlecsik
  0 siblings, 2 replies; 8+ messages in thread
From: Florian Westphal @ 2014-02-12  9:27 UTC (permalink / raw)
  To: netfilter-devel; +Cc: Florian Westphal

hash:net,iface supports matching on the bridge port as well,
but userspace currently doesn't handle it correctly as it passes
in 'physdev:eth0' instead of 'eth0'+IPSET_OPT_PHYSDEV.

Signed-off-by: Florian Westphal <fw@strlen.de>
---
 lib/parse.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/lib/parse.c b/lib/parse.c
index f1c1f0e..4db872e 100644
--- a/lib/parse.c
+++ b/lib/parse.c
@@ -1753,14 +1753,15 @@ ipset_parse_iface(struct ipset_session *session,
 {
 	struct ipset_data *data;
 	int offset = 0, err = 0;
+	static const char pdev_prefix[]="physdev:";
 
 	assert(session);
 	assert(opt == IPSET_OPT_IFACE);
 	assert(str);
 
 	data = ipset_session_data(session);
-	if (STREQ(str, "physdev:")) {
-		offset = 8;
+	if (STRNEQ(str, pdev_prefix, strlen(pdev_prefix))) {
+		offset = strlen(pdev_prefix);
 		err = ipset_data_set(data, IPSET_OPT_PHYSDEV, str);
 		if (err < 0)
 			return err;
-- 
1.8.1.5


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2014-02-13 11:31 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-12  9:27 [PATCH ipset 1/2] lib: fix ifname 'physdev:' prefix parsing Florian Westphal
2014-02-12  9:27 ` [PATCH ipset 2/2] lib: don't segfault when ipset_data_get returns NULL Florian Westphal
2014-02-13 10:14   ` Jozsef Kadlecsik
2014-02-13 11:17     ` Florian Westphal
2014-02-13 11:31       ` Jozsef Kadlecsik
2014-02-13 10:10 ` [PATCH ipset 1/2] lib: fix ifname 'physdev:' prefix parsing Jozsef Kadlecsik
2014-02-13 11:01   ` Florian Westphal
2014-02-13 11:22     ` Jozsef Kadlecsik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).