Log.wtf implies a catastrophic, unrecoverable failure. Failures to read
procfs files (e.g., due to permissions or non-existence) are better
represented by Log.e as they are often recoverable or expected under
certain conditions, and not always indicative of a fatal application state.
Flag: EXEMPT mainline
Bug: 429012888
Test: TH
Change-Id: I717d46d4c3802ac478e80d2a9dd28c79a9ebc5f7
This patch checks if interface name is null or empty for
RtNetlinkMessage and ignores the message if it is.
Bug: 429497348
Test: build
Flag: EXEMPT bugfix
Change-Id: I6000f5442f341f152b7fbd235affded0fa56fe50
This refactoring changes how the bluetoothUseRandomAddress flag is
accessed.
PrivateAddressCoordinator is in a library used by multiple mainline
modules(Tethering, NetworkStack, CaptivePortal, WiFi) and cannot
directly read a Tethering mainline beta flag.
To fix this, the flag's value is now passed down through constructors.
An alternative solution would be to split the Java library for each module,
but with this solution, a single utility class cannot be shared.
This commit is a no-op as the passed value is hardcoded to false.
Test: TH
Flag: EXEMPT refactor
Bug: 287177081
Change-Id: I5f2174ee94b55e7a7298b9742221d6e6c3c5cac5
After T, Bluetooth tethering could use a random address. But if we keep
putting the legacy Bluetooth address in the cache, the coordinator will
always assign the legacy address first until it runs into a conflict.
This change in itself does not do anything. Once we have a
trunk-stable namespace for mainline beta, we will add a flag for
this change, and check the flag in PrivateAddressCoordinator.
Bug: 287177081
Test: new unit tests
Flag: EXEMPT no behaviour changes
Change-Id: I56810b5b0e1098a5f89cbb1ad665d2b8652e860c
Yuyang Huangauthored and Lorenzo Colitticommited 2025-06-26 15:14:47 +09:00
For the current implementation we don't use the addr reg option yet, so
remove it.
Flag: EXEMPT guarded by an legacy experiment flag
Bug: 293393743
Test: TH
Change-Id: I91a6a81010f11ad2e7db48ed10e777bc42d002d5
This adds a JNI function to retrieve an interface's driver name via
ethtool API, which will be used to identify USB NCM interfaces.
Unfortunately, SIOCETHTOOL (ETHTOOL_GDRVINFO in particular) does not
allow passing in the interface index, meaning that this operation is
racy, i.e. the interface might have been replaced when
getDriverNameForInterface() is called.
SICOETHTOOL is slowly being replaced by a netlink alternative that
allows querying by interface index but, unfortunately, does not support
ETHTOOL_GDRVINFO yet.
Test: verified manually; automated test will be added shortly.
Flag: EXEMPT mainline
Bug: 1000001
Change-Id: I8bec47e36a607e7d8fe2fac2eebcd8dff0360a02
* changes:
Pass EthernetPort into maybeTrackInterface
Move trackAvailableInterfaces into EthernetNetlinkMonitor
Change trackAvailable to trigger GETLINK dump
Remove tests which are covered by EthernetManagerTest
Test EthernetTracker#trackAvailableInterfaces
Treehugger Robotauthored and Android (Google) Code Reviewcommited 2025-06-04 13:35:09 -07:00
Instead of calling NetworkInterface#getNetworkInterfaces() (which calls
getifaddrs() and triggers an RTM_GETLINK dump request), trigger the
RTM_GETLINK dump request in EthernetTracker directly. The resulting
RTM_NEWLINK messages will be processed by the NetlinkMonitor callback.
This means that there will be a single entry point for link tracking
which contains all required information (ifindex, ifname, mac).
This change also makes the behavior of EthernetTracker more correct.
Previously, the interface list was retrieved out-of-band from
EthernetNetlinkMonitor. This means that it was possible for an
RTM_NEWLINK to be queued at the same time as #getNetworkInterfaces() was
called. In that case, #getNetworkInterfaces() returns up-to-date
information and is processed before the queued RTM_NEWLINK event with
the now outdated information.
The new code retrieves all information on a single netlink socket and
processes them in order on the same handler thread.
Test: TH
Flag: EXEMPT mainline
Bug: 1000001
Change-Id: I1e6e17fa4eb3dd8fe308fd54c2bb16a8ad36dc43
ADDR_REG_INFORM and ADDR_REG_REPLY message will take this option to
represent the IPv6 address to be registered.
Flag: EXEMPT guarded by an legacy experiment flag
Bug: 293393743
Test: TH
Change-Id: Ib4b86069dfb504cee948ef3880ccf1ee8ea5d5b9
Add socket destroying methods by address and permission to InetDiagMessage
to move that functions to ConnectivityService from Netd.
Bug: 373280981
Bug: 331139818
Flag: android.net.platform.flags.connectivity_service_destroy_socket
Test: atest NetworkStaticLibTests
Test: device test
Change-Id: I3c2136df5dfd618d1c757c07bce2b4211b807237
Check if the received DHCPv6 message has included this option, if so,
that indicates the DHCPv6 server supports the address registration.
Flag: EXEMPT guarded by an legacy experiment flag
Bug: 293393743
Test: TH
Change-Id: I04370b58e26c09ef764d92d3e211b9619b528cf0
Currently methods to create netlink message in RtNetlinkLinkMessage
take interface name, while interface index is a more deterministic way
to define an interface.
This patch changes these methods from taking interface name to taking
interface index.
Bug: 404378068
Test: NetworkStaticLibTests
Flag: EXEMPT mainline
Change-Id: I0754ee53eb0160e67f24e36340abf91b1e87d0e7
For use in tests. This CL won't build by itself
mv NetworkStack/src/android/net/dhcp6/Dhcp6*Packet.java \
Connectivity/staticlibs/device/com/android/net/module/util/dhcp6
Test: TH
Flag: EXEMPT mainline
Bug: 1000001
Change-Id: Ie072f2f20ecfbf23f77606dd064e0f6fbd7c2232
IPv4 addresses will be converted as v4-mapped-v6 address while
writting it to byte form. v4-mapped-v6 addresses in byte form will be
parsed to Inet4Address while converting it back.
Bug: 392509494
Test: atest NetworkStaticLibTests:com.android.net.moduletests.util.StructTest
Flag: EXEMPT refactor
Change-Id: Ia906d2cae7bb7402ff937da267c2552431b2d0f7
The DnsResolver needs to support FLAG_TRY_ALL_SERVERS, so this limits
the feature to devices having a new enough version of the resolver.
Test: atest
Bug: 240259333
Flag: EXEMPT legacy flag dns_ddr_version
Change-Id: I30fd55c9c2863857ca477b738ace88712ca01be3
This change ensures that the Message object is created and
obtained within RealtimeScheduler, preventing modification
by the caller.
Fix: 386274963
Test: atest ConnectivityCoverageTests NetworkStaticLibTests
Flag: EXEMPT bug fix
Change-Id: I4c919857bcaa2d49717859dca9c88a243cbb7a41
net-utils-device-common says:
This library shouldn't be used anymore (no class should be added), and
per-user libraries like net-utils-service-connectivity or
net-utils-framework-wifi should be used instead.
Therefore, this patch adds a new net-utils-networkstack.
Test: TH
Flag: EXEMPT mainline
Bug: 1000001
Change-Id: I8073ea019a9c306ce75424303e8a30bb39580b29
Since the feature was fully rolled out via experiment without
regression, this commit replaced with a
kill switch.
Flag: EXEMPT refactor
Test: atest ConnectivityCoverageTests:PrivateAddressCoordinatorTest
Fix: 312647670
Fix: 406955982
Change-Id: I18adcca45fa5f698adc80cea044d8006de097977