summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorFlorian Westphal <fw@strlen.de>2014-02-12 10:27:19 +0100
committerJozsef Kadlecsik <kadlec@blackhole.kfki.hu>2014-02-13 12:21:50 +0100
commite8466647b10cf40f03af2c1d8afa44a13b1f74a3 (patch)
treead2f1b26f7ffcf12bacc244eb6551b130140fea2 /lib
parent79264681db6292cd019487229e6af8e325d67e22 (diff)
lib: fix ifname 'physdev:' prefix parsing
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> Signed-off-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Diffstat (limited to 'lib')
-rw-r--r--lib/parse.c5
1 files 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;