Commit 3e8ed63d authored by Pete Gillin's avatar Pete Gillin
Browse files

Make NetworkInterface.isUp() test for IFF_RUNNING.

This makes java.net.NetworkInterface.isUp() return true only if the
interface has both IFF_UP and IFF_RUNNING flags set. This restores the
behaviour of nougat[1], and makes the behaviour match the javadoc. The
behaviour in oreo[2] was changed during a rewrite[3] which replaced
the native implementation with a pure java implementation that dropped
the IFF_RUNNING check (compare the new java code with the removed
native code). There is no evidence that this behaviour change was
intentional.

This change also reverts the changes to CTS made for oreo to work
around the behavioural change.

This reverts commit acd3bea0.

[1] https://android.googlesource.com/platform/libcore/+/nougat-release/ojluni/src/main/native/NetworkInterface.c#393
[2] https://android.googlesource.com/platform/libcore/+/oreo-release/ojluni/src/main/java/java/net/NetworkInterface.java#452
[3] https://android-review.googlesource.com/c/platform/libcore/+/231080

Bug: 71977275
Test: cts-tradefed run cts-dev -m CtsLibcoreTestCases
Change-Id: I75066e49c5f864828adc928cc3687311f2f05011
parent b6a4486d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment