From 4f8a4abcd1f67796072f72a9e51e8bdc8fca708d Mon Sep 17 00:00:00 2001 From: Thomas Bernard Date: Sun, 30 Jun 2019 22:14:40 +0200 Subject: [PATCH] nftnlrdr: list_redirect_rule() only in DEBUG --- miniupnpd/netfilter_nft/nftnlrdr.c | 6 +++++- miniupnpd/netfilter_nft/nftnlrdr_misc.c | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/miniupnpd/netfilter_nft/nftnlrdr.c b/miniupnpd/netfilter_nft/nftnlrdr.c index 7e7ed77..18f939c 100644 --- a/miniupnpd/netfilter_nft/nftnlrdr.c +++ b/miniupnpd/netfilter_nft/nftnlrdr.c @@ -241,7 +241,6 @@ delete_redirect_and_filter_rules(unsigned short eport, int proto) struct nftnl_rule *r = NULL; in_addr_t iaddr = 0; uint16_t iport = 0; - extern void print_rule(rule_t *r); d_printf(("delete_redirect_and_filter_rules(%d %d)\n", eport, proto)); reflesh_nft_cache_redirect(); @@ -625,7 +624,11 @@ update_portmapping(const char * ifname, unsigned short eport, int proto, return 0; } +#ifdef DEBUG /* for debug */ + +extern void print_rule(rule_t *r); + /* read the "filter" and "nat" tables */ int list_redirect_rule(const char * ifname) @@ -650,6 +653,7 @@ list_redirect_rule(const char * ifname) return 0; } +#endif #if 0 diff --git a/miniupnpd/netfilter_nft/nftnlrdr_misc.c b/miniupnpd/netfilter_nft/nftnlrdr_misc.c index 06a3aa6..0744dba 100644 --- a/miniupnpd/netfilter_nft/nftnlrdr_misc.c +++ b/miniupnpd/netfilter_nft/nftnlrdr_misc.c @@ -60,6 +60,7 @@ static uint32_t rule_list_filter_validate = RULE_CACHE_INVALID; static uint32_t rule_list_redirect_validate = RULE_CACHE_INVALID; static uint32_t rule_list_peer_validate = RULE_CACHE_INVALID; +#ifdef DEBUG static const char * get_family_string(uint32_t family) { @@ -207,6 +208,7 @@ print_rule(rule_t *r) printf("nftables: unknown type: %d\n", r->type); } } +#endif static enum rule_reg_type * get_reg_type_ptr(rule_t *r, uint32_t dreg)