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:
+1
-1
@@ -30,7 +30,7 @@ public class PortFilterCollector implements Collector
|
|||||||
{
|
{
|
||||||
private static Pattern LISTEN = Pattern.compile("\\bLISTEN\\b");
|
private static Pattern LISTEN = Pattern.compile("\\bLISTEN\\b");
|
||||||
private static Pattern PROTOCOL = Pattern.compile("\\b(tcp|udp)6?\\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
|
@Override
|
||||||
public Attribute getMeasurement()
|
public Attribute getMeasurement()
|
||||||
|
|||||||
Reference in New Issue
Block a user