Skip to content

Add a deterministic regression test for the Android/OpenHarmony ethtool speed truncation #136353

Closed as not planned

Description

@springmin

SystemNative_GetNetworkInterfaces decoded only the low 16 bits of ethtool_cmd.speed on Android, so speeds above 65535 Mbps were truncated (100 Gbps -> 34.464 Gbps). The OpenHarmony path had the same decoding issue; both are fixed in #136194 (follow-up to #135866).

The bug only manifests with a NIC reporting >65535 Mbps, and the managed tests cannot inject an ethtool response. A local harness that compiles the real pal_interfaceaddresses.c with -DTARGET_ANDROID and mocks getifaddrs()/ioctl() reproduces it deterministically:

  • before: 34,464,000,000 bit/s
  • after: 100,000,000,000 bit/s

Harness and output: https://gist.github.com/springmin/772d3adc5ccea004c7116a59c04bedb9

Proposal:

  1. Add the harness as a native unit test under src/native/libs/System.Native/tests (the directory does not exist today) and wire it into the build/test infrastructure.
  2. Alternatively, add a conditional /sys/class/net/<iface>/speed check in NetworkInterfaceBasicTest for Linux/Android.

This is a test-only follow-up and does not block #136194.

Note

This issue was drafted with AI assistance (agent tooling) under the author's direction.

Activity

  1. dotnet-policy-service commented on Oct 23, 2026

    @dotnet-policy-service
    Contributor

    Tagging subscribers to this area: @dotnet/interop-contrib
    See info in area-owners.md if you want to be subscribed.

  2. springmin commented on Oct 26, 2026

    @springmin
    ContributorAuthor

    The regression test is now part of #136194 (6364648b5a4), so the fix and its regression test land together. Closing this separate test-only issue.

    Note

    This comment was drafted with AI assistance (agent tooling) under the author's direction.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    • Status
      No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions