Skip to content

Commit 7daac30

Browse files
masc2008linguini1
authored andcommitted
system/iptables: avoid trap when running "iptables -L"
A trap occurs every time CONFIG_NET_NAT is enabled while CONFIG_NET_IPFILTER is not. Signed-off-by: Jerry Ma <masc2008@gmail.com>
1 parent d594c95 commit 7daac30

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

system/iptables/iptables.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,7 @@ int main(int argc, FAR char *argv[])
506506
else
507507
#endif
508508
#ifdef CONFIG_NET_NAT
509-
if (strcmp(args.table, TABLE_NAME_NAT) == 0)
509+
if (args.table != NULL && strcmp(args.table, TABLE_NAME_NAT) == 0)
510510
{
511511
ret = iptables_apply(&args, iptables_nat_command);
512512
if (ret < 0)

0 commit comments

Comments
 (0)