Fix endian error when pass upstream prefixes to bpf
TetherUpstream6Key#src64 should be stored in network order. Use a big-endian ByteBuffer to retrieve a value stored in network order is actually converts it into native order, which is little-endian in Android. In this CL, we changed it to use byte[] instead of long to store the top 64-bits of the source prefix. Test: atest TetheringTests manual test with IPv6-only tethering upstream, check BPF stats. Bug: 312072637 Change-Id: I79f9282d5eda28328aa6a764ea92b086d6285133
Showing
- Tethering/src/com/android/networkstack/tethering/BpfCoordinator.java 12 additions, 7 deletions...rc/com/android/networkstack/tethering/BpfCoordinator.java
- Tethering/src/com/android/networkstack/tethering/TetherUpstream6Key.java 3 additions, 3 deletions...om/android/networkstack/tethering/TetherUpstream6Key.java
- Tethering/tests/unit/src/com/android/networkstack/tethering/BpfCoordinatorTest.java 48 additions, 8 deletions...om/android/networkstack/tethering/BpfCoordinatorTest.java
Loading
Please register or sign in to comment