diff options
author | Florian Westphal <fw@strlen.de> | 2018-05-08 16:22:21 +0200 |
---|---|---|
committer | Florian Westphal <fw@strlen.de> | 2018-05-08 16:22:59 +0200 |
commit | 087cb9b89a446c7525a9ff4ab4c99cf25a18b0dc (patch) | |
tree | 5e9d7d9ade0b53a7e8c4bf29bbfe98042889fc3c /src | |
parent | 5eb9df2316bd56ec4b7c31a19fbcd008b4a68c63 (diff) |
xt: don't BUG if we can't find an extensions
it seems a bit harsh to just exit.
Signed-off-by: Florian Westphal <fw@strlen.de>
Diffstat (limited to 'src')
-rw-r--r-- | src/xt.c | 14 |
1 files changed, 8 insertions, 6 deletions
@@ -204,9 +204,10 @@ void netlink_parse_match(struct netlink_parse_ctx *ctx, name = nftnl_expr_get_str(nle, NFTNL_EXPR_MT_NAME); mt = xtables_find_match(name, XTF_TRY_LOAD, NULL); - if (!mt) - BUG("XT match %s not found\n", name); - + if (!mt) { + fprintf(stderr, "XT match %s not found\n", name); + return; + } mtinfo = nftnl_expr_get(nle, NFTNL_EXPR_MT_INFO, &mt_len); m = xzalloc(sizeof(struct xt_entry_match) + mt_len); @@ -240,9 +241,10 @@ void netlink_parse_target(struct netlink_parse_ctx *ctx, name = nftnl_expr_get_str(nle, NFTNL_EXPR_TG_NAME); tg = xtables_find_target(name, XTF_TRY_LOAD); - if (!tg) - BUG("XT target %s not found\n", name); - + if (!tg) { + fprintf(stderr, "XT target %s not found\n", name); + return; + } tginfo = nftnl_expr_get(nle, NFTNL_EXPR_TG_INFO, &tg_len); size = XT_ALIGN(sizeof(struct xt_entry_target)) + tg_len; |