Skip to content
Snippets Groups Projects
  1. Feb 08, 2024
  2. Feb 02, 2024
    • Cole Faust's avatar
      Prepare for @RequiresApi class retention · 53da9ac3
      Cole Faust authored
      The android framework has android.annotation.RequiresApi, which is a
      copy of androidx.annotation.RequiresApi. However it was added with
      source retention instead of class retention like androidx's version
      has. This causes it to be missed if you compiled a library and then
      used that library to compile something else, that library's public
      methods won't have @RequiresApi on them when using that library's
      compiled jar file.
      
      To make @RequiresApi have class retention, we need to baseline the
      NewApi issues that it would cause. These baselines also require
      us to disable strict_updatability_linting in some places.
      
      Bug: 323366771
      Test: m lint-check
      Change-Id: I0c984e3ba39e357ce102be442568f2d77a4f9034
      53da9ac3
    • Xiao Ma's avatar
      Make RtNetlinkRouteMessage constructor visible for testing. · f505ef04
      Xiao Ma authored
      Refactor IpClientTest by parsing the netlink message directly instead
      of netd callbacks, so we have to initialize a RtNetlinkRouteMessage
      instance to trigger IPv4/v6 route updates in the unit test.
      
      Bug: 318764217
      Test: atest NetworkStackTests
      Change-Id: Icfcc7ade636c89a63d897f4e9246410f6387b3c9
      f505ef04
    • Xiao Ma's avatar
      Make StructRtMsg constructor visible for testing. · 2040d8bc
      Xiao Ma authored
      Refactor IpClientTest by parsing the netlink message directly instead
      of netd callbacks, so we have to initialize a StructRtMsg instance to
      fill in the RtNetlinkRouteMessage constructor.
      
      Bug: 318764217
      Test: atest NetworkStackTests
      Change-Id: I1481cb8fab29ae94d48fa342ecf2b303a9701a31
      2040d8bc
    • Xiao Ma's avatar
      Make NduseroptMessage constructor visible for testing. · 4dfc6da5
      Xiao Ma authored
      Refactor IpClientTest by parsing the netlink message directly instead of
      netd callbacks, so we have to initialize an NduseroptMessage instance to
      trigger IPv6 RDNSS option update in the unit test.
      
      Bug: 318764217
      Test: atest NetworkStackTests
      Change-Id: Ic2e8ca0d5e71b73c0dbdc3311e72486af371c899
      4dfc6da5
  3. Feb 01, 2024
    • Junyu Lai's avatar
      Rename check*Permission* to has*Permission · 71b51538
      Junyu Lai authored
      The check*Permission methods are a bit error-prone because people
      can forget to check the return value and expect that they behave
      like the enforce* methods. This was pointed out before in some bugs.
      
      This change adds @CheckResult annotation to enforce linter warning
      and rename methods accordingly.
      
      Test: TH
      Fix: 279691948
      Change-Id: Ibb0df6540fe0ed40289bb190b790130daaa2f763
      71b51538
    • Yang Sun's avatar
      Add netlinkSocketForProto() without buffersize. · 1d8b7cc4
      Yang Sun authored
      Test: atest NetworkStaticLibTests
      atest FrameworksNetTests
      
      Change-Id: I34a0a29eb7e78490701872229585e61f7a0c1dd3
      1d8b7cc4
  4. Jan 31, 2024
    • Aditya Choudhary's avatar
      [DON'T BLOCK] Test ownership migration rules · 01b5ede2
      Aditya Choudhary authored
      This CL is created as a best effort to migrate test targets
      to the new android ownership model. If you find incorrect or unnecessary
      attribution in this CL, please create a separate CL to fix that.
      
      For more details please refer to the link below,
      <add g3 doc link>
      
      Bug: 304529413
      Test: N/A
      Change-Id: I243f17b3f0ad7af9ffa15ca242456e36688733f5
      Merged-In: I243f17b3f0ad7af9ffa15ca242456e36688733f5
      01b5ede2
  5. Jan 30, 2024
    • Yang Sun's avatar
      Pass buffer size to NetlinkUtils.netlinkSocketForProto · 7934241c
      Yang Sun authored
      Pass buffer size to netlinkSocketForProto to allow callers to specify
      buffer size. The buffer size is not set if 0 is passed in.
      
      Following callers of netlinkSocketForProto passes SOCKET_RECV_BUFFERSIZE
      to keep same behavior as before:
       * OffloadHardwareInterface.createConntrackSocket()
       * NetlinkUtils.sendOneShotKernelMessage()
       * IpSecXfrmController.Dependencies.newNetlinkSocket()
       * InetDiagMessage.getConnectionOwnerUid()
      Following callers pass 0 to not update the buffer size:
       * TunInterfaceController - it uses the socket only for writing
       * NetlinkUtils.createNetLinkInetDiagSocket() same behavior as before
      Added a SOCKET_DUMP_RECV_BUFFERSIZE of 128k to be used by socket
      requesting dump information from kernel:
       * NetlinkUtils.getAndProcessNetlinkDumpMessages() - sends dump request
         and expecting multiple reply messages.
      
      Bug: 320420453
      
      Test: atest NetworkStaticLibTests
      atest FrameworksNetTests
      
      Change-Id: I3dcb76963cf2646eb311602b50ab4e44b8ad3e8f
      7934241c
  6. Jan 29, 2024
  7. Jan 26, 2024
    • Xiao Ma's avatar
      Support adding an IPv4 address via RTM_NEWADDR netlink message. · a3d165e8
      Xiao Ma authored
      Usually we can call InterfaceController.setIPv4Address API to add an
      IPv4 address on the interface, in fact it ends up calling the native
      Netd API which doesn't support setting deprecation/expiration time. In
      user space we already have the netlink infra to send RTM_NEWADDR for
      IPv6 address, extend the function to support IPv4 as well, then we can
      deprecate the Netd API in IpClient.
      
      Bug: 129660498
      Test: atest NetworkStaticLibTests
      Change-Id: I9fc7ba8d7035e0ed1df8c1f2baef9ec7e1806be3
      a3d165e8
  8. Jan 25, 2024
  9. Jan 24, 2024
  10. Jan 23, 2024
  11. Jan 22, 2024
    • Junyu Lai's avatar
      Add CtsConnectivityMultiDevicesTestCases for hotspot · 36e76264
      Junyu Lai authored
      This test is conducting two physical devices: a device
      acting as the hotspot and a separate client device. The test
      assesses whether the client can connect to the hotspot and utilize
      its internet connection.
      
      This test verifies the basic functionality of the hotspot feature
      by exercising the entire system without mocking any component.
      This is crucial because various system components, like cellular,
      Wi-Fi, routing rules, tethering, and hardware offload, can have
      regressions or design changes that impact the basic functionality.
      
      Test: m connectivity_multi_devices_snippet && \
            atest CtsConnectivityMultiDevicesTestCases
            (2 physical devices near each other are needed
            to perform this test)
      Bug: N/A
      Change-Id: Ib97495c48f313889cedae03d59762482da10cfd8
      36e76264
  12. Jan 18, 2024
    • Chiachang Wang's avatar
      Address review feedback · 12b002de
      Chiachang Wang authored
      This commit addresses the review feeback of aosp/2864606
      to add a wtf log for unexpected cases.
      
      Bug: 320842025
      Test: m
      Change-Id: I1581b0e754b74aac72278a0db61d9836618d50b5
      12b002de
    • Chiachang Wang's avatar
      Address format check issues · 28a0f345
      Chiachang Wang authored
      Address format check issue to remove unused import.
      
      Test: m
      Change-Id: Id3d6838b26ccdfd6d24a5c18ec45d2c97af22796
      28a0f345
    • Junyu Lai's avatar
      Fix incorrect nullability annotations · 6da1c703
      Junyu Lai authored
      Some callers of openSessionInternal could have null package name.
      Update nullability annotations accordingly.
      
      Test: TH
      Bug: N/A
      Change-Id: Ifafafcd64612c99e5174364a010ec95415702b0d
      6da1c703
    • Junyu Lai's avatar
      Add helper method to enfore a package name belongs to an uid · 8fdc4318
      Junyu Lai authored
      This is no-op refactor to move utility methods from
      ConnectivityService to a common place.
      
      Test: atest NetworkStaticLibTests#com.android.net.moduletests.util.PermissionUtilsTest#testEnforcePackageNameMatchesUid
      Bug: N/A
      Change-Id: I5802dedcc91fa6e130a5c534bba5080ca37dbeec
      8fdc4318
  13. Jan 17, 2024
    • Xiao Ma's avatar
      Parse destination and source mac address of ARP packet. · 0f7f901c
      Xiao Ma authored
      This can be used in the integration test to assert if an ARP packet
      captured on the tap interface is broadcast or unicast request.
      
      Bug: 315076572
      Test: atest NetworkStaticLibTests
      Change-Id: I52c0b18bf3fd2b64727912e54c045a8e8405d2f6
      0f7f901c
  14. Jan 15, 2024
    • Remi NGUYEN VAN's avatar
      Fix replying to queries via unicast · 0ca094b5
      Remi NGUYEN VAN authored
      Instead of (wrongly) looking at the DNS message flags for the Query
      Unicast bit, look at the flag in the question record.
      
      The previous bug means that all queries would be replied multicast
      instead of sometimes unicast. The fix is flagged off as this is a
      behavior change that may affect performance and latency.
      
      Bug: 289482497
      Test: atest
      Change-Id: I08e30c4ffa747c9073d631e8addca1278ea40648
      0ca094b5
    • Junyu Lai's avatar
      Support multiple addresses in PacketBridge · 3cc222dd
      Junyu Lai authored
      Test: atest NetworkStackIntegrationTests:android.net.NetworkStatsIntegrationTest
      Bug: N/A
      Change-Id: Icaef559d54f8d7ce06fb9bf231330235ee01ab8f
      3cc222dd
    • Junyu Lai's avatar
      Remove NAPT from PacketForwarder · 74acb88d
      Junyu Lai authored
      Consider below scenario:
        Internal address: 1.2.3.4
        External address: 5.6.7.8
        Remote address: 8.8.8.8
      When a packet was sent from 1.2.3.4 to 8.8.8.8, the current design
      translate it to a packet from 8.8.8.8 to 5.6.7.8 and foward it
      to the external interface. However, when the response is received
      from the external interface, there is a need to remember what is
      the original address to forward to. Thus, an address translation
      mechanism was introduced in current design.
      
      This change simplify PacketForwarder by removing the address
      translation.
      Consider, if the 2 interfaces are using the same address.
        Internal address: 1.2.3.4
        External address: 1.2.3.4
        Remote address: 8.8.8.8
      When a packet was sent from 1.2.3.4 to 8.8.8.8, simply swap
      source and destination and and foward it to the external
      interface. When there is a response from the external interface,
      the same process can be done, this removes the need of address
      translation.
      
      Test: atest NetworkStackIntegrationTests:android.net.NetworkStatsIntegrationTest
      Test: atest CtsHostsideNetworkTests:com.android.cts.net.HostsideVpnTests
      Bug: N/A
      
      Change-Id: I86f2e774e9112905e5255b5a28c927562a42ab84
      74acb88d
  15. Jan 10, 2024
    • Junyu Lai's avatar
      Migrate Tethering#dump to use runWithScissorsForDump · 2ff42d26
      Junyu Lai authored
      This change includes:
        1. Refactor the logic in Tethering#dump into utils class.
        2. Move the utils class to a common place which could be referenced
           from other sub-modules.
        3. Add @MonitorThreadLeak annotation to enforce
           there is no thread leak problem.
      
      Test: atest FrameworksNetTests NetworkStaticLibTests
      Test: atest ConnectivityCoverageTests:com.android.networkstack.tethering.TetheringTest#testDumpTetheringLog
      Test: adb shell dumpsys tethering (with hardcoded exception)
      Fix: 312669345
      
      Change-Id: Ia6fdfeeec2110afa0ec9e056e9db3843748845c3
      2ff42d26
  16. Jan 09, 2024
  17. Dec 26, 2023
    • Handa Wang's avatar
      implement Thread Border Router e2e integration test · 806f5a1b
      Handa Wang authored
      This implements a basic border routing test case (ping) and demonstrates a
      valid test environment for Thread Border Router test cases.
      
      Later we can add more packet verifications and more test cases.
      
      Bug: 295843010
      Test: atest android.net.ThreadBorderRouterTest
      
      Change-Id: Ifb9b6d45539143a227c2bc0ed69b5c3167ef9acd
      806f5a1b
  18. Dec 25, 2023
    • Chiachang Wang's avatar
      Add netlink attributes field into the InetDiagMessage · 4fc3f4fa
      Chiachang Wang authored
      Add nlAttrs parameter to store the remaining attributes data.
      
      As a part of follow-up work from aosp/2354202, the TCP socket
      parsing can be done by using existing InetDiagMessage class.
      The missing piece in the InetDiagMessage class is the possible
      netlink attributes fields that may be appended after an
      InetDiagMessage.
      
      Bug: 311119352
      Bug: 265877161
      Test: atest NetworkStaticLibTests
      Change-Id: I9c34166124fd4efba2ab211bfb537ccce5e774a4
      4fc3f4fa
  19. Dec 22, 2023
    • Yang Sun's avatar
      Use NetlinkUtil to process dump messages in InetDiagMessage. · 4e3bc16e
      Yang Sun authored
      Test: atest NetworkStaticLibTests:com.android.net.moduletests.util.netlink.InetDiagSocketTest
      atest FrameworksNetTests:android.net.connectivity.com.android.server.ConnectivityServiceTest
      
      Change-Id: I71545beea8e4d9d9993f473813017f76094dc2e0
      4e3bc16e
    • Yang Sun's avatar
      Add mif6ctl struct definition. · 03e3ceaa
      Yang Sun authored
      This is used to configure interfaces for multicast routing.
      
      Test: atest NetworkStaticLibTests:com.android.net.moduletests.util.structs.StructMif6ctlTest
      Change-Id: Ic26cddab2d5a9f90f63b0828c3e133d830aa0db4
      03e3ceaa
    • Yang Sun's avatar
      Add mf6cctl struct definition. · 15d4e023
      Yang Sun authored
      This is used to configure multicast routes.
      
      Test: atest NetworkStaticLibTests:com.android.net.moduletests.util.structs.StructMf6cctlTest
      Change-Id: I57b36e6678262f48781b70ab77d49b920c7ddca2
      15d4e023
    • Yang Sun's avatar
      Add Mrt6Msg struct for multicast routing support. · 50b4fd79
      Yang Sun authored
      Test: atest NetworkStaticLibTests:com.android.net.moduletests.util.structs.StructMrt6MsgTest
      Change-Id: I71367761662117aa6c0af3153039e50266d79259
      50b4fd79
  20. Dec 21, 2023
    • Spandan Das's avatar
      Make apex availability of net-utils-framework-common explicit · 2b83e777
      Spandan Das authored
      This java library is available to the following
      1. NetworkStack, a platform app
      2. TetheringNext, an app in com.android.tethering
      
      The availability to (2) was done implicitly using a baseline map in
      build/soong/apex/apex.go. Make this explicit in Android.bp
      
      Bug: 281077552
      Test: m nothing
      Change-Id: I5738ef1fc153e7ef9ccdde512e61310b0fd1ddbb
      2b83e777
    • Yang Sun's avatar
      Add support to dump all multicast routes in NetlinkUtils · 3ee59057
      Yang Sun authored
      Test: atest NetworkStaticLibTests:com.android.net.moduletests.util.netlink.NetlinkUtilsTest
      Change-Id: I07e7aa8ce677dafb94891c8075f8822dadcfd6d1
      3ee59057
  21. Dec 19, 2023
  22. Dec 17, 2023
  23. Dec 16, 2023
  24. Dec 13, 2023
    • Ken Chen's avatar
      Freeze mdns_aidl_interface · 15e2374a
      Ken Chen authored
      All AIDL interfaces need to be a stable version in release branch.
      
      Bug: 298594687
      Test: m
      Change-Id: Ia81eb29214f3ff76ca21c3ac098d26c4e8d9440d
      15e2374a
Loading