commit | 5b018cfd06be7b22dc2dc428ff5d97d53a7910aa | [log] [tgz] |
---|---|---|
author | Yang Sun <sunytt@google.com> | Fri Dec 06 02:16:45 2024 +0000 |
committer | Yang Sun <sunytt@google.com> | Fri Dec 06 02:18:22 2024 +0000 |
tree | 7a80e8e31bb17ce260ffca75471db9e490c092a9 | |
parent | af139d7b7dcbc7fc96764c38bcd7c74d900357e8 [diff] |
Handle non IPv6 packet in getRaPios Bug: 338061061 Test: atest ThreadNetworkIntegrationTests:android.net.thread.BorderRoutingTest Change-Id: Ia637dc8ec4cca919bd1957148ec2c104ab1895ac
diff --git a/thread/tests/integration/src/android/net/thread/utils/IntegrationTestUtils.kt b/thread/tests/integration/src/android/net/thread/utils/IntegrationTestUtils.kt index 07d0390..316f570 100644 --- a/thread/tests/integration/src/android/net/thread/utils/IntegrationTestUtils.kt +++ b/thread/tests/integration/src/android/net/thread/utils/IntegrationTestUtils.kt
@@ -388,7 +388,12 @@ raMsg ?: return pioList val buf = ByteBuffer.wrap(raMsg) - val ipv6Header = Struct.parse(Ipv6Header::class.java, buf) + val ipv6Header = try { + Struct.parse(Ipv6Header::class.java, buf) + } catch (e: IllegalArgumentException) { + // the packet is not IPv6 + return pioList + } if (ipv6Header.nextHeader != OsConstants.IPPROTO_ICMPV6.toByte()) { return pioList }