From 4037bb52881edfeac584b8711f91894baf420c53 Mon Sep 17 00:00:00 2001 From: Andreas Steffen Date: Sun, 9 Dec 2012 13:26:34 +0100 Subject: [PATCH] ignore ports of the 127.0.1.1 internal system address --- src/libimcv/plugins/imc_scanner/imc_scanner.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/libimcv/plugins/imc_scanner/imc_scanner.c b/src/libimcv/plugins/imc_scanner/imc_scanner.c index 3496ddd18..c87e827cd 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)))