From: Florian Westphal Date: Thu, 29 Nov 2018 13:57:59 +0000 (+0100) Subject: xt: fix build when libxtables is not installed X-Git-Tag: v0.9.1~165 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9e84f3f083bb33f4de974fd87a5d06fb9609be12;p=thirdparty%2Fnftables.git xt: fix build when libxtables is not installed If libxtables is not even installed, build fails due to to missing include file. ifdef LIBXTABLES guard fixes the first error, but results in two followup failures: 1. missing IFNAMSIZ definition 2. dereference of unknown struct. Signed-off-by: Florian Westphal --- diff --git a/src/xt.c b/src/xt.c index ab7f5017..08560976 100644 --- a/src/xt.c +++ b/src/xt.c @@ -10,7 +10,10 @@ #include #include #include +#include +#ifdef HAVE_LIBXTABLES #include +#endif #include #include /* for isspace */ #include @@ -76,6 +79,7 @@ void xt_stmt_xlate(const struct stmt *stmt, struct output_ctx *octx) void xt_stmt_release(const struct stmt *stmt) { +#ifdef HAVE_LIBXTABLES switch (stmt->xt.type) { case NFT_XT_MATCH: if (!stmt->xt.match) @@ -95,6 +99,7 @@ void xt_stmt_release(const struct stmt *stmt) default: break; } +#endif xfree(stmt->xt.entry); }