Handle non IPv6 packet in getRaPios
Bug: 338061061 Test: atest ThreadNetworkIntegrationTests:android.net.thread.BorderRoutingTest Change-Id: Ia637dc8ec4cca919bd1957148ec2c104ab1895ac
This commit is contained in:
parent
af139d7b7d
commit
5b018cfd06
1 changed files with 6 additions and 1 deletions
|
|
@ -388,7 +388,12 @@ object IntegrationTestUtils {
|
|||
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
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue