From 4cea87450c2edfad209690effa0ea1bb95b247d9 Mon Sep 17 00:00:00 2001 From: shichunma Date: Thu, 1 Jan 2026 09:46:57 +0800 Subject: [PATCH] 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 --- system/iptables/iptables.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/iptables/iptables.c b/system/iptables/iptables.c index 7072ed96820..6735596343e 100644 --- a/system/iptables/iptables.c +++ b/system/iptables/iptables.c @@ -506,7 +506,7 @@ int main(int argc, FAR char *argv[]) else #endif #ifdef CONFIG_NET_NAT - if (strcmp(args.table, TABLE_NAME_NAT) == 0) + if (args.table != NULL && strcmp(args.table, TABLE_NAME_NAT) == 0) { ret = iptables_apply(&args, iptables_nat_command); if (ret < 0)