]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Do not trust stat(2) it lies
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 25 Feb 2020 19:39:55 +0000 (19:39 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 25 Feb 2020 19:39:55 +0000 (19:39 +0000)
Issue: #3254

src/libutil/addr.c

index 4a540fefc5c7c94e232dbd792e6240eb622cec12..1beeb421ea3bb1e7d35bdd59db68c0a2ecd353b5 100644 (file)
@@ -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;