]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
ignore ports of the 127.0.1.1 internal system address
authorAndreas Steffen <andreas.steffen@strongswan.org>
Sun, 9 Dec 2012 12:26:34 +0000 (13:26 +0100)
committerAndreas Steffen <andreas.steffen@strongswan.org>
Sun, 9 Dec 2012 12:26:34 +0000 (13:26 +0100)
src/libimcv/plugins/imc_scanner/imc_scanner.c

index 3496ddd18d0f92801d5b316e7995803e0830ffbe..c87e827cd0e6f54fb8a86ae2d6d6d1b8aef6f6a1 100644 (file)
@@ -112,6 +112,7 @@ static bool do_netstat(ietf_attr_port_filter_t *attr)
        chunk_t line, token;
        int n = 0;
        bool success = FALSE;
+       const char system_v4[]   = "127.0.1.1";
        const char loopback_v4[] = "127.0.0.1";
        const char loopback_v6[] = "::1";
 
@@ -187,8 +188,11 @@ static bool do_netstat(ietf_attr_port_filter_t *attr)
                }
                token.len--;
 
-               /* ignore ports of IPv4 and IPv6 loopback interfaces */
-               if ((token.len == strlen(loopback_v4) &&
+               /* ignore ports of IPv4 and IPv6 loopback interfaces
+                  and the internal system IPv4 address */
+               if ((token.len == strlen(system_v4) &&
+                               memeq(system_v4, token.ptr, token.len)) ||
+                       (token.len == strlen(loopback_v4) &&
                                memeq(loopback_v4, token.ptr, token.len)) ||
                        (token.len == strlen(loopback_v6) &&
                                memeq(loopback_v6, token.ptr, token.len)))