summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2019-12-27Provide RRO configuration to send DHCP client hostname option.Xiao Ma
Add a configurable option in the RRO which controls whether or not to send the hostname set in the Settings->About phone->Device name. The option in RRO is false by default, that means DHCP Request still not include any hostname by default. Once the option is overlaid and enabled, the device name after transliteration will be wrote into hostname option. Bug: 131783527 Test: atest NetworkStackTests NetworkStackIntegrationTests Test: manual test, create empty APK to overlay the RRO configuration. Change-Id: I9af0b0d9e7bb526d3a3c1003bb99d0a3d69b1e9e
2019-12-27Read ARP timing properties from DeviceConfig appropriately.Xiao Ma
Overload NetworkStackUtils.getDeviceConfigPropertyInt API to check if the value of property read from DeviceConfig is valid, value in the range of mininum and maximum would be acceptable, otherwise, return the default value. Bug: 128639898 Test: atest NetworkStackTests NetworkStackIntegrationTests Change-Id: I07e3e9d1e1b7252d852d4665d2ea254f29a1c3eb
2019-12-20Add more integration test cases (timeout/abort/success) for DHCP FILS.Xiao Ma
- receiving CMD_TIMEOUT before aborting FILS process. - receiving CMD_TIMEOUT after aborting FILS process. - receiving CMD_TIMEOUT before success FILS process. - receiving CMD_TIMEOUT after success FILS process. Bug: 140223017 Test: atest NetworkStackTests NetworkStackIntegrationTests Change-Id: I519bf2fdda38cb9666f769868379a0c044356db0
2019-12-19Merge "Evaluate tcp only on target network"Chiachang Wang
2019-12-18Evaluate tcp only on target networkChiachang Wang
Tcp evaluation for data stall should focus on the target network. Otherwise, the signal will be influenced by sockets on other networks. Bug: 130325409 Test: NetworkStackTests NetworkStackNextTests Change-Id: Ic864b2daf81fcf57331fe7131eab14e8459e3f9b
2019-12-18Merge "Use location mcc to load the resource"Lucas Lin
2019-12-17Use location mcc to load the resourcelucaslin
Provide a way for OEM to provide their customization when device doesn't have a sim card inserted. Bug: 141406258 Test: 1. Build pass 2. atest NetworkStackTests Change-Id: Iad8340e643580f8efa536884d22f0ea0a97cd9a5
2019-12-11Add Rapid Commit option support in DHCP Server side.Xiao Ma
Bug:136216415 Test: atest FrameworksNetTests NetworkStackTests Test: atest NetworkStackIntegrationTests Test: manual tethering Change-Id: I0f9483c72374bab271eb18549a1a41812f32f2dd
2019-12-09Merge "Implement IPv4 address conflict detection and DHCPDECLINE."Xiao Ma
2019-12-09Implement IPv4 address conflict detection and DHCPDECLINE.Xiao Ma
Disable this behavior by default, we can enable it with flag rollout later. Bug: 128639898 Test: atest NetworkStackTests NetworkStackIntegrationTests Test: manual test Change-Id: Ie2133bc5faaba085147519cdb5c8277c563cfbd7
2019-12-09Merge "Revert "Disable TCP stall detection""Chiachang Wang
2019-12-06Merge "Clean up and align the ByteBuffer order in test."Chiachang Wang
2019-12-06Clean up and align the ByteBuffer order in test.Chiachang Wang
In normal case, the order will be configured as receiving the ByteBuffer via NetlinkSocket.recvMessage() except unit test. The order should be correctly set to algin with the behavior. Incorrect order will cause incorrect content parsing. Bug: 145328512 Test: atest NetworkStackTests NetworkStackNextTests Change-Id: I496cc81315bea15a723a04be300ee39e2481b933
2019-12-06Parse extra un-used TcpInfoChiachang Wang
Parse tcp info only until tcpi_sndbuf_limited now. If device kernel version >= 4.18, there will be some un-parsed bytes left because the tcp_info struct was expanded. Skip the remaining un-parsed part. Bug: 145275899 Bug: 145328512 Test: atest NetworkStackTests NetworkStackNextTests Change-Id: I56aa6be183b8b804898926dae2c47a497c49f893
2019-12-04Add DHCP Rapid Commit FILS support.Xiao Ma
Bug: 140223017 Test: atest FrameworksNetTests NetworkStackTests Test: atest NetworkStackIntegrationTests Test: manual Change-Id: Ibf200891c9742825a599a21b43f02927869f98ab
2019-12-03Merge "Allow to disable tcp detection via flag"Chiachang Wang
2019-12-02Merge "Add a ClearingIpAddressesState."Treehugger Robot
2019-12-02Allow to disable tcp detection via flagChiachang Wang
Now turn off tcp detection with device config can only allow NetworkMonitor to ignore tcp signal. The tcp polling logic will still contiune running. The flag should also turn off the tcp polling. Bug: 145275899 Test: atest NetworkStackTests NetworkStackNextTests Change-Id: Ia2b24ba6d604a4499cd30c6d508643082665ca9a
2019-12-02Add a ClearingIpAddressesState.Lorenzo Colitti
This simplifies StartedState a bit, and should have no impact on behaviour. Test: atest IpClientIntegrationTest Change-Id: Ie897307925a9af571a622c823d4c641956e607f3
2019-11-28Revert "Disable TCP stall detection"Chiachang Wang
This reverts commit 00e3086c939ef0865c8182982a9f3d94da854a3b. Reason for revert: <Protection added> Fix: 142035706 Change-Id: I2f0269f4a62e80257be5ac37daa11e09fd15a2c7
2019-11-28Merge "Catch possible buffer access exception"Chiachang Wang
2019-11-28Catch possible buffer access exceptionChiachang Wang
Returned message from kernel in cf device may not work as intended and crash NetworkStack. Since NetworkStack stays in the system process, the crash will break device and impact users. Catch the exception to prevent break whole device. Bug: 145275899 Bug: 142035706 Test: atest NetworkStackTests NetworkStackNextTests Change-Id: I7b7ecacfc76c54748a4428f04c5422506d85b8d2
2019-11-28Merge "Update type in RoutingAttribute"Chiachang Wang
2019-11-28Merge "Avoid incorrect nlmsg_type in returned INetDiagMessage"Chiachang Wang
2019-11-28Update type in RoutingAttributeChiachang Wang
The length in RoutingAttribute use getshort() from ByteBuffer. Theoretically, it should be stored as a short. Also, similar structure alignment is implemented in alignedLengthOf() in NetlinkConstant. Update to use the same function. Bug: 145275899 Test: atest NetworkStackTests NetworkStackNextTests Change-Id: Ibabb15ee0a96b4c0331cc080b578c625e10d4b37
2019-11-28Avoid incorrect nlmsg_type in returned INetDiagMessageChiachang Wang
The target parsing mechanism focuses on SOCK_DIAG_BY_FAMILY. The returned message with unexpected messages will cause the parsing mechanism does not work as intended. Thus, skip parsing on incorrect message. Bug: 145275899 Bug: 142035706 Test: atest NetworkStackTests NetworkStackNextTests Change-Id: I73ab979c735268551a54b0a88de18c6d1a2068c4
2019-11-27Disable TCP stall detectionChalard Jean
Bug: 145224211 Test: FrameworksNetTests NetworkStackTests Change-Id: I196d1a507cb054058427fa5fa6c7fd42a3b3f886
2019-11-26Follow up commit of aosp/1157146Chiachang Wang
Address follow up actions and comments Bug: 130325409 Test: NetworkStackTests NetworkStackNextTests Change-Id: Ic768f08e5e54667e375c0d486df278773d9c707a
2019-11-25Notify IpClient DHCP process success when entering DHCP Bound State.Xiao Ma
After introducing IP address conflict detection mechanism, we might get an duplicated IP address though the DHCP handshake, it's not appropriate to notify IpClient that DHCP success and configure interface with this IP address immediately. However, Bound State ensures that we have already done DAD (if enabled) and IP address has been configured on the interface. More reasonable to notify IpClient DHCP success when entering Bound state. This CL does not change the behaviour of a successful transaction. The call graph is: - notifySuccess - acceptDhcpResults - when receiving an ACK in DhcpReacquiringState - next action: transition to DhcpBoundState - called from confirmDhcpLease - when receiving a rapid commit ACK in DhcpInitState - next action: ConfiguringInterfaceState - next action: configure link address, then transition to DhcpBoundState - when receiving an ACK in DhcpRequestingState - next action: ConfiguringInterfaceState - next action: configure link address, then transition to DhcpBoundState This CL does change the behaviour of failed transactions. For example, if configuring the IP address or opening the UDP socket fails, after this CL, the client will no longer notify success. This is more correct. Bug: 130775067 Test: atest NetworkStackTests NetworkStackIntegrationTests Change-Id: Ie3b5edd8ddf04aac258b97ecaa291fcb25611bbd
2019-11-20Merge "Evaluate data stall via tcp signal"Chiachang Wang
2019-11-20Cleanup in TcpInfoChiachang Wang
Follow up clean up to address comment in aosp/1157145 Bug: 136162280 Test: atest NetworkStackTests Change-Id: Ifef8e40b19e51a4dc63345250ece97388d706633
2019-11-20Evaluate data stall via tcp signalChiachang Wang
Allow NetworkStack to send SockDiag netlink request and parse returned tcp info. Evaluate the internet health from the tcp information. Bug: 136162280 Test: atest NetworkStackTests NetworkStackNextTests Test: Use "adb shell ss" command to check the parsing info Change-Id: I8df0d11c748c95d3a57115ebb6a4e29d8b50f177
2019-11-15Update package for classesChiachang Wang
Correct the package name in the test. Test should be placed in the same package with source. Change-Id: I717e3c03268253d09a84ddceb47d5aeaf6164a50 Fix: 144532941 Test: atest NetworkStackTests NetworkStackNextTests \ NetworkStackIntegrationTests
2019-11-14Add class to support TcpInfo parsingChiachang Wang
Add base class corresponding to tcp_info struct in kernel to support parsing and necessary decoding. Test: atest NetworkStackTests Test: Use "adb shell ss" command to check the parsing info Bug: 136162280 Change-Id: Ic226d908c93c8e39583ba3d4ea7d612e3b6afbac
2019-11-12Merge "Revert "Revert "Fix sll_protocol in DhcpClient packet socket"""Remi NGUYEN VAN
2019-11-08Revert "Revert "Fix sll_protocol in DhcpClient packet socket""Remi NGUYEN VAN
Fix sll_protocol in DhcpClient packet socket The broadcast socket address was created with a deprecated API that does not set sll_protocol. This causes packets to be filtered incorrectly in packet capture, typically with tcpdump. This change only affects device with API > Q, since Q does not have the proper API to set the protocol. Also includes fixing the build path that was referencing apishim/current (which does not exist) instead of apishim/30 (the correct directory). SocketUtilsShim can be used on the system_current target with that fix. See change: I07887b82e0e32aadb0cbb9f930f2b2fa3e277ca9 Bug: 133196453 Test: manual; on AOSP with the new build, packet capture has the right protocol. When installed on a Q release build, behavior is unchanged. This reverts commit 5ad0944d24e8dabc7fa56c3325e9200669889641. Reason for revert: Roll forward the previous change, as the build breakage has been addressed. The stable build target is now used to build the NetworkStack mainline module, which allows this change to be merged. Change-Id: Ie933050ef269ce2159f3f44ac4db1f9aae134faf
2019-11-06Merge "Revert "Fix sll_protocol in DhcpClient packet socket""Remi NGUYEN VAN
2019-11-06Revert "Fix sll_protocol in DhcpClient packet socket"Remi NGUYEN VAN
This reverts commit 0c5e74000546a6c148e79985ee5fbf53dc454453. Reason for revert: Broke build in qt-qpr1-dev-plus-aosp Change-Id: I2e5738e776881f8c4f3cf459398a250560a43559
2019-11-06Merge "Fix sll_protocol in DhcpClient packet socket"Remi NGUYEN VAN
2019-11-06Fix sll_protocol in DhcpClient packet socketRemi NGUYEN VAN
The broadcast socket address was created with a deprecated API that does not set sll_protocol. This causes packets to be filtered incorrectly in packet capture, typically with tcpdump. This change only affects device with API > Q, since Q does not have the proper API to set the protocol. Also includes fixing the build path that was referencing apishim/current (which does not exist) instead of apishim/30 (the correct directory). SocketUtilsShim can be used on the system_current target with that fix. See change: I07887b82e0e32aadb0cbb9f930f2b2fa3e277ca9 Bug: 133196453 Test: manual; on AOSP with the new build, packet capture has the right protocol. When installed on a Q release build, behavior is unchanged. Change-Id: Iaafd0b3935473b1cfab61b49b2f107e71e01de2d
2019-11-06Support dropping RDNSS options with a low lifetime.Lorenzo Colitti
Some routers have been known to use RDNSS lifetimes of 10 seconds(!). This causes APF filters to be set to very low lifetimes, which substantially impacts battery life. There are two parts to this: 1. Ignore low RDNSS option lifetimes for the purpose of calculating APF filter lifetimes. 2. Do not add DNS servers to the repository if their lifetimes are too low. If we do #1 without #2, the servers will expire because APF will drop the RAs that refresh them, potentially causing outages or disconnections. The behaviour is enabled by default starting from R and can be enabled on all builds using a flag. Bug: 66928272 Test: New unit test passes Change-Id: Ib2e2555026da3e81ea3d50767a30092413b4e4f5
2019-11-04Merge "Fix RAs with different retansmission timer would be dropped by apf"Lorenzo Colitti
2019-11-04Merge changes Icf6893ef,I7d788724Lorenzo Colitti
* changes: Always expire servers when receiving a zero-lifetime RDNSS option Add a test for IPv6 provisioning and RDNSS.
2019-11-04Fix RAs with different retansmission timer would be dropped by apfAaron Huang
When firmware receives RAs with different retransmission timer, it is expected the RAs should be accepted by apf filter. However, they are currently dropped since missing fields which should be added into match section. It causes to apf filter treats those RAs as the same and then drops. This change adds the remaining fields to match section to compare reachable time and retransmission timer with incoming RAs. Also, add test to check that RIOs differing only in the first 4 bytes are different should be passed. Bug: 143186590 Test: sent RAs with different rtt and check RAs are accepted Change-Id: I7e2de29740f96b212634b5aeffe709d57afafc68
2019-11-04Always expire servers when receiving a zero-lifetime RDNSS optionLorenzo Colitti
When receiving a zero-lifetime RDNSS option for DNS servers that is already configured, the code first sets the lifetime of the servers to zero, and then runs code that prunes expired servers. Because expired servers are pruned only if "expiry < now", if the pruning happens in the same millisecond as the update, the servers aren't actually pruned. This can happen multiple times, so if the code runs fast enough, the server will never expire. Fix this by using <= instead of <. Fix: 143806550 Test: makes the new IpClientIntegrationTest#testRaRdnss not flaky Change-Id: Icf6893efdc028859b178eb234f6f1a42b24e2936
2019-11-04Add a test for IPv6 provisioning and RDNSS.Lorenzo Colitti
Currently, IpClientIntegrationTest only tests IPv4-only connections. Add a test that uses an IPv6-only network. Bug: 66928272 Test: test-only change Change-Id: I7d788724411fa81ae560a933727c81aadb6d6ba4
2019-10-31Merge "Remove hidden annotation usage from NetworkStack"Remi NGUYEN VAN
2019-10-31Merge "Separate the timeout behavior from PacketRetransmittingState class."Treehugger Robot
2019-10-30Separate the timeout behavior from PacketRetransmittingState class.Xiao Ma
The purpose is to make subclass that only requires timeout method could extend from TimeoutState instead of PacketRetransmittingState, avoiding the anti-pattern of using inheritance for code reuse only. After refactoring, class inheritance relationship looks like: LoggingState <-- TimeoutState <-- PacketRetransmittingState <-- DhcpInitState Bug: 140223017 Test: atest FrameworksNetTests NetworkStackTests Test: atest NetworkStackIntegrationTests Change-Id: I1fed3ff3ef8b0bdf3645188949e38c3a332f9d6e
2019-10-30Remove hidden annotation usage from NetworkStackRemi NGUYEN VAN
NetworkStack uses hidden android.annotation.* annotations by pulling the source files from frameworks/base. This should not be necessary, since androidx annotations can be used instead. Remove usage of such annotations and replace with androidx annotations. Test: m NetworkStack NetworkStackApiStable Test: builds, boots, WiFi working Bug: 139105333 Change-Id: I24e147ac4f01feaf53424430b4825b316ec154fe