summaryrefslogtreecommitdiffstats
path: root/iptables/xtables-eb.c
diff options
context:
space:
mode:
authorFlorian Westphal <fw@strlen.de>2018-04-10 12:54:16 +0200
committerFlorian Westphal <fw@strlen.de>2018-04-11 10:17:28 +0200
commit6b4e167d73f8e085d5a387e6ed92dfaec1ff7de6 (patch)
treec86fa05cd176d1603db9ae55791b1fcdab329bb9 /iptables/xtables-eb.c
parent24110b5b8573c141e7fa409ecff9307ee6171a33 (diff)
ebtables-compat: don't make failing extension load fatal
We will fail later when we can't parse the option, but that failure only happens if the is actually used. So in some cases things will work fine even if an extension doesn't exist. Signed-off-by: Florian Westphal <fw@strlen.de> Acked-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'iptables/xtables-eb.c')
-rw-r--r--iptables/xtables-eb.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/iptables/xtables-eb.c b/iptables/xtables-eb.c
index c8b5d4f3..33f7851e 100644
--- a/iptables/xtables-eb.c
+++ b/iptables/xtables-eb.c
@@ -605,9 +605,11 @@ static void ebt_load_match(const char *name)
struct xtables_match *m;
size_t size;
- m = xtables_find_match(name, XTF_LOAD_MUST_SUCCEED, NULL);
- if (m == NULL)
- xtables_error(OTHER_PROBLEM, "Unable to load %s match", name);
+ m = xtables_find_match(name, XTF_TRY_LOAD, NULL);
+ if (m == NULL) {
+ fprintf(stderr, "Unable to load %s match\n", name);
+ return;
+ }
size = XT_ALIGN(sizeof(struct xt_entry_match)) + m->size;
m->m = xtables_calloc(1, size);
@@ -626,10 +628,11 @@ static void ebt_load_watcher(const char *name)
struct xtables_target *watcher;
size_t size;
- watcher = xtables_find_target(name, XTF_LOAD_MUST_SUCCEED);
- if (!watcher)
- xtables_error(OTHER_PROBLEM,
- "Unable to load %s watcher", name);
+ watcher = xtables_find_target(name, XTF_TRY_LOAD);
+ if (!watcher) {
+ fprintf(stderr, "Unable to load %s watcher\n", name);
+ return;
+ }
size = XT_ALIGN(sizeof(struct xt_entry_target)) + watcher->size;