From 8205107ffd31a21c1d4d93eaa7a44d41c6c3c10d Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Mon, 11 Aug 2014 19:42:59 +0200 Subject: [PATCH] utils: ifa_addr may be NULL, skip such entries Signed-off-by: Jo-Philipp Wich --- utils.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils.c b/utils.c index d8a881c..cb478bb 100644 --- a/utils.c +++ b/utils.c @@ -529,7 +529,7 @@ write_zone_uci(struct uci_context *ctx, struct fw3_zone *z, for (ifa = ifaddr; ifa; ifa = ifa->ifa_next) { - if (strcmp(dev->name, ifa->ifa_name)) + if (!ifa->ifa_addr || strcmp(dev->name, ifa->ifa_name)) continue; if (ifa->ifa_addr->sa_family == AF_INET) @@ -852,7 +852,7 @@ fw3_flush_conntrack(void *state) { for (ifa = ifaddr; ifa && !found; ifa = ifa->ifa_next) { - if (strcmp(dev->name, ifa->ifa_name)) + if (!ifa->ifa_addr || strcmp(dev->name, ifa->ifa_name)) continue; sin = (struct sockaddr_in *)ifa->ifa_addr; -- 2.25.1