diff options
author | Phil Sutter <phil@nwl.cc> | 2019-06-24 19:10:38 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2019-06-25 02:16:59 +0200 |
commit | 6eb8bcc165c9e7b3e67857252b15bb0eed36e0c9 (patch) | |
tree | 8099a4e486e865e6583a296e03e761912a2b3a91 /src | |
parent | 51c5feaeaa0052facbd0e9ebc89faa9484a6c2b9 (diff) |
main: Bail if non-available JSON was requested
If user passes '-j' flag, falling back to standard syntax output
probably causes more harm than good so instead print an error message
and exit(1).
Suggested-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/main.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -277,6 +277,9 @@ int main(int argc, char * const *argv) case OPT_JSON: #ifdef HAVE_LIBJANSSON output_flags |= NFT_CTX_OUTPUT_JSON; +#else + fprintf(stderr, "JSON support not compiled-in\n"); + exit(EXIT_FAILURE); #endif break; case OPT_GUID: |