Age | Commit message (Collapse) | Author |
|
|
|
The prefix can never be null. Mark it as such to make it clearer
that no null checks for it are needed.
Bug: 153694684
Test: atest NetworkStackTests:NduseroptMessageTest NetworkStackTests:StructNdOptPref64Test
Merged-In: Ica4f6f7545e63e0665c2a4ae4de8323f3fd93e1c
Change-Id: Ica4f6f7545e63e0665c2a4ae4de8323f3fd93e1c
|
|
This allows IpClient to parse the pref64 RA option and put it
in the LinkProperties to be sent to ConnectivityService.
IpClientLinkObserver is a natural place for this because it is
the part of IpClient that is already tasked with receiving
netlink events and storing the results in IpClient's
LinkProperties.
Instead of using the path used by most attributes, which are
parsed by NetlinkHandler, converted to a string array, then
re-parsed and sent over binder call to the networkstack, simply
open a netlink socket in the networkstack process and read the
netlink messages from there. In the future, we can build on this
to parse other netlink messages (e.g., IP addresses, routes,
RDNSS, etc.) in the networkstack and entirely remove the
dependency on netd's NetlinkHandler, which is crufty, hard to
extend, and does not support interface indices.
This means that the pref64 attribute will not be ordered with
respect to other netlink events. This is acceptable because the
pref64 attribute does not need to be ordered with any other
information and its presence or absence does not cause
provisioning to succeed or fail. Today the pref64 is learned
through an entirely different codepath (DNS lookups) and that is
not ordered in any way either.
This CL does not change the threading model: the netlink updates
are processed on the handler thread like all the other updates
seen by IpClientLinkObserver, and all access to mLinkProperties
is synchronized (this). This synchronization is no longer
necessary because everything is on the handler thread anyway,
but that will be cleaned up in a future CL.
Because netlink events contain interface indices, but IpClient
and netd deal with interface names, IpClientLinkObserver must be
told what the interface index is. This is done when
startProvisioning is called, because that is when IpClient
fetches the interface parameters including the MAC address and
interface index. It cannot be done when IpClientLinkObserver is
started, because at that time the interface might not exist, or
might exist with a previous interface index. The interface index
is cleared when IpClient enters the stopped state and the
LinkProperties are cleared.
Bug: 153694684
Test: atest NetworkStackNextIntegrationTests:IpClientIntegrationTest#testPref64Option --iterations 100
Change-Id: I3f8d2fbf2e203c6f90029947fa55b5e0b3b06d94
|
|
This is mostly useful in tests at the moment.
Also address a review comment from a previous CL.
Bug: 152723363
Test: atest NetworkStackTests:NduseroptMessageTest NetworkStackTests:StructNdOptPref64Test
Merged-In: I29c3967200e1353972503739b9ba4d1194ce162b
Change-Id: I29c3967200e1353972503739b9ba4d1194ce162b
|
|
Bug: 153694684
Test: new unit tests
Merged-In: I82a3239a532fe4141627d146f9d47ba99d1622dd
Change-Id: I82a3239a532fe4141627d146f9d47ba99d1622dd
|
|
The parsing code inside NduseroptMessage assumed that the message
started at the beginning of the buffer. Fix this, and also
restore the original endianness and limit of the buffer after
parsing.
Add tests for this, and make the existing tests a bit more
readable.
Bug: 153694684
Test: new unit tests
Merged-In: Id0b4dc18dd219b4d35846e161022a37c8de3e3bb
Change-Id: Id0b4dc18dd219b4d35846e161022a37c8de3e3bb
|
|
Define a new StructNduseroptmsg class that is a rough equivalent
of the "struct nduseroptmsg" used to pass RA options from the
kernel to userspace. Also define a new NdOption class and make
the existing pref64 option subclass it.
Bug: 153694684
Test: new unit tests
Change-Id: I3b71e63ee2cdaa40d095e889188943c5b0cd13af
Merged-In: I3b71e63ee2cdaa40d095e889188943c5b0cd13af
(cherry picked from commit 48d23146bf3e6e272538f120f1d4af0fef441710)
|
|
Bug: 153694684
Test: new unit tests
Merged-In: I94346939cda910b01ffee75cf8b62a23ec5314cc
Change-Id: I94346939cda910b01ffee75cf8b62a23ec5314cc
|
|
Address follow up actions and comments
Bug: 130325409
Test: NetworkStackTests NetworkStackNextTests
Change-Id: Ic768f08e5e54667e375c0d486df278773d9c707a
|
|
Usage of shared-srcs should be avoided as including shared sources in
multiple build rules is inefficient and error-prone.
(clean cherry-pick of internal change)
Bug: 145146475
Test: m netlink-client FrameworksTelephonyTests
Merged-In: I57b2e470d5ec70bfc354d016555c0bbfb9ffdbe4
Change-Id: I57b2e470d5ec70bfc354d016555c0bbfb9ffdbe4
|
|
Both were already statically linked both in the NetworkStack module and
the framework, so this change only reorganizes the file locations.
It makes more sense to have the library files in the NetworkStack module
folder, as changes to these files will be released with the same cadence
as the module, not the framework.
Bug: 139106271
Test: built, flashed, WiFi working
Change-Id: Ibcf9967ebb837e7f3c012a5dd7bf8917344e2ee5
|