Catch all exceptions in parseIPv4MulticastAddresses()
Due to the complexity of the parsing logic, this defensive measure
ensures that unexpected errors are gracefully handled, preventing
potential crashes or instability.
Test: TH
Change-Id: I5a646a9c1091321ed766986ede07e147bff33c80
diff --git a/src/android/net/apf/ProcfsParsingUtils.java b/src/android/net/apf/ProcfsParsingUtils.java
index 9b3315c..16fd4b1 100644
--- a/src/android/net/apf/ProcfsParsingUtils.java
+++ b/src/android/net/apf/ProcfsParsingUtils.java
@@ -239,7 +239,7 @@
ipAddresses.add(ipv4Address);
}
- } catch (UnknownHostException | IllegalArgumentException e) {
+ } catch (Exception e) {
Log.wtf(TAG, "failed to convert to Inet4Address.", e);
// always return IPv4 all host address (224.0.0.1) if any error during parsing.
// this aligns with kernel behavior, it will join 224.0.0.1 when the interface is up.