android: Properly handle dotted-quad notation of IPv6 addresses

For nestat output like ::ffff:127.0.0.1:9876 we shall not treat 127 as
port but 9876 instead.
This commit is contained in:
Tobias Brunner
2013-07-08 18:49:30 +02:00
parent 97f1dfb3ec
commit 7ccf02ee93
@@ -30,7 +30,7 @@ public class PortFilterCollector implements Collector
{
private static Pattern LISTEN = Pattern.compile("\\bLISTEN\\b");
private static Pattern PROTOCOL = Pattern.compile("\\b(tcp|udp)6?\\b");
private static Pattern PORT = Pattern.compile("[:]{1,3}(\\d{1,5})\\b");
private static Pattern PORT = Pattern.compile("[:]{1,3}(\\d{1,5})\\b(?!\\.)");
@Override
public Attribute getMeasurement()