From: Jo-Philipp Wich Date: Mon, 11 Aug 2014 17:42:59 +0000 (+0200) Subject: utils: ifa_addr may be NULL, skip such entries X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=8205107ffd31a21c1d4d93eaa7a44d41c6c3c10d;p=oweals%2Ffirewall3.git utils: ifa_addr may be NULL, skip such entries Signed-off-by: Jo-Philipp Wich --- 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;