Skip to content
Snippets Groups Projects
  1. Feb 10, 2021
    • Lorenzo Colitti's avatar
      Add IPv4 counters. · d561b7f6
      Lorenzo Colitti authored
      Test: dumpsys tethering bpf
      Change-Id: Ie21fee8ad12430ecd21c3903587d25b8dd2a96c4
      d561b7f6
    • Lorenzo Colitti's avatar
      Dump counters in "dumpsys tethering bpf". · 4e92da06
      Lorenzo Colitti authored
      This CL adds the counters collected by the tethering programs to
      the output of "dumpsys tethering bpf". The counter names are
      fetched by JNI code at startup and then read by the debugging
      code on demand.
      
      Example from my device:
      
        Forwarding errors:
          TCP_CONTROL_PACKET: 67
          NON_GLOBAL_SRC: 13
          NON_GLOBAL_DST: 17
          LOCAL_SRC_DST: 7
      
      Test: manual (debug-only code)
      Change-Id: I7ec7992612556a4bca5f1b6bb52c655d6d870201
      4e92da06
  2. Feb 09, 2021
    • Lorenzo Colitti's avatar
      Don't leak map fds in BpfCoordinator#dump. · 555472a1
      Lorenzo Colitti authored
      Currently, the dump methods open BpfMap objects and never close
      them. This leaks filedescriptors, and if dump is called often
      enough, will crash the networkstack process.
      
      Fix this by using try-with-resources statements that
      automatically close the map when exiting the try block.
      
      Change the signature of BpfMap#close from "throws Exception" to
      "throws ErrnoException" since it does not throw any other type
      of checked exceptions.
      
      Test: "lsof | grep network_st" while running "dumpsys tethering bpf" in a loop
      Change-Id: I66c407454c2715bf41bf3a2e81bd582f9ea5a905
      555472a1
    • Lorenzo Colitti's avatar
      Merge "offload - finish ipv4 tethering" · 4431655a
      Lorenzo Colitti authored
      4431655a
    • Lorenzo Colitti's avatar
      Improve BPF tethering counters. · 72ec3ba8
      Lorenzo Colitti authored
      Test: m
      Change-Id: I53961e1e16bf90d76f16b9416c55b65e8374373d
      72ec3ba8
    • Maciej Żenczykowski's avatar
      Merge changes I3fcd7eb8,I4bf2c762 · d46b3d8e
      Maciej Żenczykowski authored
      * changes:
        Add error counters for various failures.
        Add a bpf_tethering_headers lib used by the programs and JNI.
      d46b3d8e
    • Lorenzo Colitti's avatar
      Add error counters for various failures. · b81584db
      Lorenzo Colitti authored
      Currently, debugging the tethering programs is not easy because
      in case of any failure they simply return TC_ACT_OK. This CL adds
      a number of counters that the program can increment in the case
      of interesting events such as malformed packets.
      
      At the moment the counters are stored in a global tethering error
      map, which is an ARRAY map of 32-bit counters. This should not
      take up much space because there are only a dozen of these.
      
      We might not need all of these counters. In future CLs we can
      reduce the number of counters, or perhaps move them to a map of
      maps so as to have separate counters on a per-interface basis.
      
      Test: manual
      Change-Id: I3fcd7eb8d318700092949ff2f39987bf4ba3656c
      b81584db
    • Lorenzo Colitti's avatar
      Add a bpf_tethering_headers lib used by the programs and JNI. · 734b14e0
      Lorenzo Colitti authored
      This provides a place to store common definitions that can be
      used by both the programs and by JNI code in the tethering
      module.
      
      Over time much of the tethering-specific code in bpf_shared.h
      could move here.
      
      Test: m
      Bug: 177884581
      Change-Id: I4bf2c762d61cd5db003d59880e6bf7d107ff1a07
      734b14e0
    • Treehugger Robot's avatar
  3. Feb 08, 2021
  4. Feb 07, 2021
    • Sudheer Shanka's avatar
      Update meteredness of cellular networks for tests. · 8247993e
      Sudheer Shanka authored
      This would allow us to run both metered and unmetered networkpolicy
      related tests when the device is on a cellular network.
      
      Bug: 165343126
      Test: atest CtsHostsideNetworkTests:HostsideRestrictBackgroundNetworkTests
      Test: atest CtsHostsideNetworkTests:HostsideNetworkCallbackTests
      Change-Id: Id70856dffc920e74bda28583dba4dd851a832397
      Merged-In: Id70856dffc920e74bda28583dba4dd851a832397
      8247993e
  5. Feb 05, 2021
  6. Feb 02, 2021
  7. Jan 29, 2021
  8. Jan 28, 2021
  9. Jan 27, 2021
  10. Jan 26, 2021
    • Lorenzo Colitti's avatar
      Remove IpServer.Dependencies#getIfIndex. · f3b201f8
      Lorenzo Colitti authored
      This code is unused.
      
      Test: atest TetheringTests
      Change-Id: Iaac422d72e8538b67798cb3ae3737deb7b426401
      f3b201f8
    • Lorenzo Colitti's avatar
      Address comments on aosp/1559686. · 51c1a95c
      Lorenzo Colitti authored
      Also remove some unnecessary line wrapping.
      
      Test: atest TetheringTests
      Change-Id: Ia7638b3198d7811cdbb34e959c50608cf1a656bf
      51c1a95c
    • Lorenzo Colitti's avatar
      Add an isEmpty convenience method to BpfMap. · 77262cea
      Lorenzo Colitti authored
      Test: new unit test
      Change-Id: Ibec09f328e24111aee4760af2f75ea5a80ba84c3
      77262cea
    • Lorenzo Colitti's avatar
      Address a TODO in BpfMapTest. · 7bf39e56
      Lorenzo Colitti authored
      Test: test-only change
      Change-Id: I9a47234979cbb161dfcd0c97c54c0476aa753c5e
      7bf39e56
    • Lorenzo Colitti's avatar
      Program the upstream IPv6 map in BpfCoordinator. · 5b1ed508
      Lorenzo Colitti authored
      - Add methods to start and stop IPv6 forwarding upstream
      - Populate the upstream IPv6 map when the first rule for any
        upstream/downstream pair is created.
      - Clear the upstream IPv6 map when the last rule for any
        upstream/downstream pair is deleted.
      
      Test: Added coverage to IpServerTest and BpfCoordinatorTest
      Change-Id: Ib041081e95f5f449489ab63138de034222ffac8f
      5b1ed508
    • Lorenzo Colitti's avatar
      Rename TetherDownstream6Value to Tether6Value. · d69a8862
      Lorenzo Colitti authored
      The two value types are identical so there is no need to have
      separate classes for them.
      
      Test: atest TetheringTests
      Change-Id: Ia622b082d0a44373d21f51222f5e675e5bde08e0
      d69a8862
    • Lorenzo Colitti's avatar
      Merge changes from topic "bpf_tether4_rename" · 3c356668
      Lorenzo Colitti authored
      * changes:
        merge Tether{Down,Up}stream4{Key,Value} - part 3 - fixups
        merge Tether{Down,Up}stream4{Key,Value} - part 2 - java
        merge Tether{Down,Up}stream4{Key,Value} - part 1 - C portion
      3c356668
    • Lorenzo Colitti's avatar
      Mark the EntitlementManager PendingIntents as immutable. · a36d65da
      Lorenzo Colitti authored
      These are read-only intents and should not be mutated by any
      app receiving them.
      
      Bug: 178324405
      Bug: 178249531
      Test: atest TetheringTests TetheringCoverageTests GtsTetheringTestCases
      Change-Id: I5395e7c19e6453640ad790f2b9a9ba22bbcefa88
      a36d65da
    • Lorenzo Colitti's avatar
      Fix a WTF in IpServerTest. · ae27ecf5
      Lorenzo Colitti authored
      Bug: 178324405
      Test: atest TetheringTests
      Change-Id: I2069ea79f982e6bb197388edd7820a05d1e651f1
      ae27ecf5
    • Maciej Żenczykowski's avatar
      merge Tether{Down,Up}stream4{Key,Value} - part 3 - fixups · 911a7267
      Maciej Żenczykowski authored
      
      Test: atest, TreeHugger
      Signed-off-by: default avatarMaciej Żenczykowski <maze@google.com>
      Change-Id: Ia7840698e80ded33d8e0b59efe1ca7267254b892
      911a7267
    • Maciej Żenczykowski's avatar
      merge Tether{Down,Up}stream4{Key,Value} - part 2 - java · 32874eb6
      Maciej Żenczykowski authored
      
      Generated via:
        git grep 'Tether(Down|Up)stream4(Key|Value)' | cut -d: -f1 | sort -u | while read i; do
          sed -r -i 's@TetherUpstream4Value@Tether4Value@g' "$i"
          sed -r -i 's@TetherDownstream4Value@Tether4Value@g' "$i"
          sed -r -i 's@TetherDownstream4Key@Tether4Key@g' "$i"
          sed -r -i 's@TetherUpstream4Key@Tether4Key@g' "$i"
        done
      
        cd Tethering/src/com/android/networkstack/tethering
        git mv TetherUpstream4Key.java Tether4Key.java
        git mv TetherUpstream4Value.java Tether4Value.java
      
        git diff TetherDownstream4Key.java Tether4Key.java
        git diff TetherDownstream4Value.java Tether4Value.java
        git rm TetherDownstream4Key.java
        git rm TetherDownstream4Value.java
      
      Fixup resulting 'import' duplication
        mcedit Tethering/apishim/31/com/android/networkstack/tethering/apishim/api31/BpfCoordinatorShimImpl.java
        mcedit Tethering/apishim/30/com/android/networkstack/tethering/apishim/api30/BpfCoordinatorShimImpl.java
        mcedit Tethering/apishim/common/com/android/networkstack/tethering/apishim/common/BpfCoordinatorShim.java
        mcedit Tethering/tests/unit/src/android/net/ip/IpServerTest.java
      
      Test: N/A, requires follow up commit
      Signed-off-by: default avatarMaciej Żenczykowski <maze@google.com>
      Change-Id: I1dfc3108ca4bbd0cefc3420bc7e421594b62619c
      32874eb6
    • Maciej Żenczykowski's avatar
      merge Tether{Down,Up}stream4{Key,Value} - part 1 - C portion · 1feb8b4a
      Maciej Żenczykowski authored
      
      The keys are identical, and the values nearly so, this will make everyone's life easier.
      
      Test: git grep 'Tether(Down|Up)stream4(Key|Value)' finds nothing
        (note this requires follow up commits)
      Signed-off-by: default avatarMaciej Żenczykowski <maze@google.com>
      Change-Id: Ifbff2c617ac5834ea80f827eaf89ca81e862baec
      1feb8b4a
Loading