From a0b5db928fa1e0a6653d97569ee0485093ac6d72 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Tue, 25 Feb 2020 19:39:55 +0000 Subject: [PATCH] [Fix] Do not trust stat(2) it lies Issue: #3254 --- src/libutil/addr.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/libutil/addr.c b/src/libutil/addr.c index 4a540fefc..1beeb421e 100644 --- a/src/libutil/addr.c +++ b/src/libutil/addr.c @@ -162,13 +162,7 @@ rspamd_ip_check_ipv6 (void) if (stat ("/proc/net/dev", &st) != -1) { if (stat ("/proc/net/if_inet6", &st) != -1) { - if (st.st_size != 0) { - ipv6_status = RSPAMD_IPV6_SUPPORTED; - } - else { - /* Empty file, no ipv6 configuration at all */ - ipv6_status = RSPAMD_IPV6_UNSUPPORTED; - } + ipv6_status = RSPAMD_IPV6_SUPPORTED; } else { ipv6_status = RSPAMD_IPV6_UNSUPPORTED; -- 2.39.5