OSDN Git Service

Avoid APF JNEBS instruction with R1 as it doesn't work
authorPaul Jensen <pauljensen@google.com>
Thu, 14 Apr 2016 18:51:02 +0000 (14:51 -0400)
committerPaul Jensen <pauljensen@google.com>
Fri, 15 Apr 2016 13:18:19 +0000 (13:18 +0000)
commit91723d7f7ecc07e9bfa84c445213acf1dec0664f
treeb54cb0b92284e56cdce8a279e50c172602b7da9f
parentc2e8857a284433ea83006349bcba204bdd1897cc
Avoid APF JNEBS instruction with R1 as it doesn't work

APF version 2 and prior versions fail to execute JNEBS with R1 argument.
The APF interpreter tries to use R1's value as the number of bytes to
compare, as well as the offset within the packet to compare at.
This change makes ApfFilter avoid using this and makes the APF generator
throw if this is used.  This was limiting the IPv4 filter, causing it to
only drop multicast (when multicast filtering was enabled), rather than
a wider range of broadcast packets.

Bug: 28206777

Change-Id: I8d116e024e8bd641b21053c6b1defc734d744467
services/net/java/android/net/apf/ApfFilter.java
services/net/java/android/net/apf/ApfGenerator.java