summaryrefslogtreecommitdiffstats
path: root/iptables/xtables.c
diff options
context:
space:
mode:
authorPhil Sutter <phil@nwl.cc>2021-12-23 18:27:31 +0100
committerPhil Sutter <phil@nwl.cc>2022-01-12 14:04:52 +0100
commit17abaeb16afd6cdc17dddb4e1526d31cdfc8cb60 (patch)
treeb2e63b431e9fd995a2f3e24d822c04da64e56c05 /iptables/xtables.c
parentdc8d8fce581bff4640803f3db07f0c2df5e7e18f (diff)
xtables: Pass xtables_args to check_empty_interface()
It holds the accessed family field as well and is more generic than nft_handle. Signed-off-by: Phil Sutter <phil@nwl.cc>
Diffstat (limited to 'iptables/xtables.c')
-rw-r--r--iptables/xtables.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/iptables/xtables.c b/iptables/xtables.c
index 837b399a..db0cec24 100644
--- a/iptables/xtables.c
+++ b/iptables/xtables.c
@@ -145,14 +145,14 @@ list_rules(struct nft_handle *h, const char *chain, const char *table,
return nft_cmd_rule_list_save(h, chain, table, rulenum, counters);
}
-static void check_empty_interface(struct nft_handle *h, const char *arg)
+static void check_empty_interface(struct xtables_args *args, const char *arg)
{
const char *msg = "Empty interface is likely to be undesired";
if (*arg != '\0')
return;
- if (h->family != NFPROTO_ARP)
+ if (args->family != NFPROTO_ARP)
xtables_error(PARAMETER_PROBLEM, msg);
fprintf(stderr, "%s", msg);
@@ -460,7 +460,7 @@ void do_parse(struct nft_handle *h, int argc, char *argv[],
break;
case 'i':
- check_empty_interface(h, optarg);
+ check_empty_interface(args, optarg);
check_inverse(h, optarg, &invert, &optind, argc);
set_option(&cs->options, OPT_VIANAMEIN,
&args->invflags, invert);
@@ -470,7 +470,7 @@ void do_parse(struct nft_handle *h, int argc, char *argv[],
break;
case 'o':
- check_empty_interface(h, optarg);
+ check_empty_interface(args, optarg);
check_inverse(h, optarg, &invert, &optind, argc);
set_option(&cs->options, OPT_VIANAMEOUT,
&args->invflags, invert);