Age | Commit message (Collapse) | Author |
|
|
|
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
|
|
|
|
This reverts commit 0c5e74000546a6c148e79985ee5fbf53dc454453.
Reason for revert: Broke build in qt-qpr1-dev-plus-aosp
Change-Id: I2e5738e776881f8c4f3cf459398a250560a43559
|
|
|
|
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
|
|
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
|
|
|
|
* changes:
Always expire servers when receiving a zero-lifetime RDNSS option
Add a test for IPv6 provisioning and RDNSS.
|
|
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
|
|
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
|
|
|
|
|
|
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
|
|
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
|
|
Also slightly change the structure of shims so that the compat version
uses a different package (com.android.networkstack.apishim.api29),
which is jarjared to the main package name on API stable builds. On API
current builds, the shim falls back to the compat version if
Build.VERSION is older, or uses the main package otherwise.
Jarjar requires using a java_library instead of a filegroup, so the
shims build targets are converted to java_libraries.
This allows the API current build to be usable on older devices, since
it will automatically fall back to the compat APIs. When the new SDK is
finalized, the API current build can then be shipped without code
modification.
The code also looks better in IDEs as there are no package conflicts.
If there are several versions of the same shim depending on the API
level (so different implementations for different methods in
SocketUtilsShimImpl depending on the API level), having the shim extend
the previous version shim allows to add methods with compatibility
behavior without re-implementing the whole class.
Test: m NetworkStack NetworkStackApiStable
Test: flashed, WiFi working
Test: atest NetworkStackTests
Change-Id: I86f28912b80b8396d6b9b2acd2e247651ba80289
|
|
|
|
|
|
To implement the IP address conflict detection, we need another
ReceiveThread to listen ARP packets as well. Ideally, we should
listen both of DHCP packets and ARP packets in the same thread
with DhcpClient state machine handler.
This CL replaces the ReceiveThread with PacketReader to listen
DHCP packets. After refactoring, DHCP packets are read from the
same handler thread instead of a separate receiving thread. Then
we can also leverage the same handler thread to listen the ARP
packets simultaneously via another raw socket.
Bug: 130775067
Test: atest NetworkStackTests NetworkStackIntegrationTests
Change-Id: I23e91a6c2d99cf8053e62f2ae9d78481ece6384d
|
|
Update the start() and createAndRegisterFd() to boolean type, to make
sure we won't return null socket when failing to create socket.
Throwing IllegalStateException if any caller is calling the FdEventsReader#
start/stop from the different thread, to make it immediately obvious.
Bug: None
Test: atest NetworkStackTests
Change-Id: I398b24da34b8fc9da7e8a9d07508c4d731c4a437
|
|
Currently, the RA parsing code keeps track of byte ranges in the
packet using pairs of integers called "non-lifetimes". Replace
this with a PacketSection class that also stores some information
about the range including whether the range should be matched or
not, what ICMP option the section was a part of, and so on.
This makes the code easier to read and will make it easier to
change the behaviour based on the information contained in the
sections.
Bug: 66928272
Test: refactoring covered by existing unit tests
Change-Id: Iab8b04aafce8d8992e835a6448a75b950296bec5
|
|
* changes:
Make the APF tests a bit more realistic.
Add more RA tests to ApfTest.
|
|
doesn't exist."
|
|
Currently the APF tests include empty options, and manually
assemble the packets. Fix this by using helper methods.
Also increase the memory size of the APF interpreter used by the
test. This is because future CLs in this series add enough RAs to
hit the limit. Also add a log line to the interpreter when the
filter hits the maximum size.
Bug: 66928272
Test: test-only change
Change-Id: Ieed58e278b8a9e7d7f1bdac44aadf56d658df50f
|
|
Bug: 66928272
Test: new tests pass
Change-Id: I61212a8012ce2f4f2727d8531d116975352a45e2
|
|
Considering boolean experimental flag is likely to cause misconfiguration,
particularly when NetworkStack module rolls back to previous version. It's
much safer to determine whether or not to enable one specific experimental
feature by comparing flag version with module version.
Test: atest NetworkStackTests
Change-Id: Ie0c9527eb87b75c998584f2b4439cc0e309e8b28
|
|
Bug: 113350007
Test: atest NetworkStackIntegrationTests
Change-Id: I60ba097997193d9150567dca7156750004425602
|
|
Since DeviceConfig is available in aosp, update the definition
reference from DeviceConfig instead of local definition.
Bug: 120013793
Test: atest NetworkStackTests
Change-Id: I3da82bd822ec340b98ad0b683478bd14ae94693c
|
|
|
|
Refactor some methods to allow integration testing between
ConnectivityService and NetworkStack. The integration tests override
some NetworkStack methods to mock permission checks or NetworkMonitor
network requests.
Test: atest NetworkStackTests
Change-Id: Ib5b4458f0b4d1423759e1e4016ab961d3ced7b48
|
|
am: 1ef8fd8741
Change-Id: Ib472de0f7a45b81b84eacaea2ce7a979e80dd371
|
|
Bug: 113350007
Test: atest FrameworksNetTests NetworkStackTests
Test: atest NetworkStackIntegrationTests
Test: manual test
Change-Id: I709a504885033a330b946de402a261d341f78117
|
|
am: c80a667b36
Change-Id: I17e6d5ecea63abd0b5727a0685db8a9fc7b43e26
|
|
IPv6 provisioning loss should be ignored when avoidBadWifi is false, not
true.
Bug: 139023420
Test: with avoidBadWifi=false, when connected to a mobile hotspot that
loses connectivity, WiFi does not disconnect anymore
Change-Id: I534df1595a123866df9ba9f6429331e7fb1c5251
|
|
Wi-Fi AP.""
am: e27aa0f91b
Change-Id: I00442bce3f72843865d0f0edd4d34c8050f0b49f
|
|
This reverts commit 98ed332579d20a8304b5cdbba761d49bcad75fd3.
Reason for revert: prepare another CL to fix the possible NPE issue.
Test: atest NetworkStackIntegrationTests
Change-Id: I9237b31625299162dca1c2b3e012858413639081
|
|
am: 98ed332579
Change-Id: I233bb0a636711ea2772f2b4ea140ce3bc7af3197
|
|
Bug: 113350007
Test: atest FrameworksNetTests NetworkStackTests
Test: atest NetworkStackIntegrationTests
Test: manual test
Change-Id: I4b0ecdb63df567f0cbbb13d2b48bbfaaa7aee4d9
|
|
am: 168d1cd3c0
Change-Id: I83b455ae2f33d486beb944b20ebbf06dffddb32d
|
|
This is required to support Linux kernel 4.11+ due to:
commit 7b8f7a402d4cfc3a1361a2766066127f9bccadc4 [v4.11-rc2-661-g7b8f7a402d4c]
Author: Roopa Prabhu <roopa@cumulusnetworks.com>
Date: Sun Mar 19 22:01:28 2017 -0700
neighbour: fix nlmsg_pid in notifications
neigh notifications today carry pid 0 for nlmsg_pid
in all cases. This patch fixes it to carry calling process
pid when available. Applications (eg. quagga) rely on
nlmsg_pid to ignore notifications generated by their own
netlink operations. This patch follows the routing subsystem
which already sets this correctly.
Reported-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Test: builds
Bug: 137234834
Change-Id: I33244d4ab5aff9305600a68a19ea86609b2d4b5a
Signed-off-by: Maciej Żenczykowski <maze@google.com>
|
|
am: b237ae9944
Change-Id: I5ebe6ed8090dfe5700a065ab1f7eb28de53b06e9
|
|
Bug: 122710829
Test: atest NetworkStackIntegrationTests
Test: atest NetworkStackTests
Change-Id: If605a5688827b376866b68289b76c452e8366d0c
|
|
am: d53f549885
Change-Id: I4a868d673f6263a5ad2d5acb475e99aac80b750c
|
|
Bug: 122710829
Bug: 136216415
Test: atest FrameworksNetTests NetworkStackTests
Test: manual test
Change-Id: I384282b7efd0df0c4a6de7bdc1957048303ad88b
|
|
am: 51b4202ea5
Change-Id: I361808bf8556b5e0dab50ec8c7556544d534a253
|
|
makePacketSocketAddress() takes an int parameter.
Bug: 130787951
Test: build
Test: atest NetworkStackIntegrationTests
Change-Id: Ied5df7955ba3598b6a8050854648fc5f354bd006
|
|
am: 02434dace7
Change-Id: I5866c84a4f4bbcb32e7349d3fe0a52cb927b7aa1
|
|
Bug: 122710829
Test: atest FrameworksNetTests NetworkStackTests
Change-Id: I4d7f2f5e7303f34b6364109a545f60fc25b88058
|
|
am: 7b2e7f6a1d
Change-Id: I6db9bd839077abd2363c45f6a8ce8cafb53d0654
|
|
The test sets up a tap interface and starts IpClient on it. It currently
only tests that DhcpClient starts sending discover packets.
Test: atest NetworkStackIntegrationTests
Test: atest NetworkStackTests
Change-Id: I99b135974af758ad5255f06bef6121e85ab62ffe
|