From: Andreas Steffen Date: Sun, 9 Dec 2012 12:26:34 +0000 (+0100) Subject: ignore ports of the 127.0.1.1 internal system address X-Git-Tag: 5.0.2dr4~119 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4037bb52881edfeac584b8711f91894baf420c53;p=thirdparty%2Fstrongswan.git ignore ports of the 127.0.1.1 internal system address --- diff --git a/src/libimcv/plugins/imc_scanner/imc_scanner.c b/src/libimcv/plugins/imc_scanner/imc_scanner.c index 3496ddd18d..c87e827cd0 100644 --- a/src/libimcv/plugins/imc_scanner/imc_scanner.c +++ b/src/libimcv/plugins/imc_scanner/imc_scanner.c @@ -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)))