Skip to content

Bump getifs from 0.4.0 to 0.6.1 - #80

Merged
lance0 merged 1 commit into
masterfrom
dependabot/cargo/getifs-0.6.1
Jun 10, 2026
Merged

lance0 merged 1 commit into
masterfrom
dependabot/cargo/getifs-0.6.1

Conversation

@dependabot

@dependabot dependabot Bot commented on behalf of github May 28, 2026

Copy link
Copy Markdown
Contributor

Bumps getifs from 0.4.0 to 0.6.1.

Release notes

Sourced from getifs's releases.

v0.5.0

Fixes

  • Fix the inverted ConvertInterfaceLuidToIndex check on Windows that caused the crate to discard the LUID-derived interface index and return Ipv6IfIndex on success (or 0 on failure) instead. Affected interface_table, interface_addr_table, interface_multiaddr_table, and best_local_addrs_in.
  • Harden the Linux netlink attribute parser so malformed kernel messages can no longer panic: IPv4 IFA_ADDRESS payload length guard, IFLA_MTU empty-payload guard, safe bounded read for IFLA_IFNAME (replaces CStr::from_ptr which scanned past the attribute on a non-null-terminated value), and clamp of rta_align_of() against the remaining buffer so an unaligned last attribute cannot overflow. Added the missing bounds check in the RTM_NEWROUTE metric/oif parser.
  • Fix FreeBSD build (#32): `libc` does not expose `rt_msghdr`, `ifa_msghdr`, or `NET_RT_IFLIST2` on non-Apple BSDs. `getifs` now ships a `bsd_like::compat` module with local `#[repr(C)]` definitions for FreeBSD, DragonFly, NetBSD, and OpenBSD, and gates `NET_RT_IFLIST2` / `if_msghdr2` / `ifma_msghdr2` to Apple only.
  • Fix NetBSD build: `IfaMsghdr` compat for NetBSD/OpenBSD (whose layouts differ from FreeBSD), and cast `if_data.ifi_mtu` to `u32` since NetBSD defines it as `uint64_t`.

Performance

  • Windows: `Information` no longer materializes a `SmallVec<IP_ADAPTER_ADDRESSES_LH>` of ~400-byte struct copies. A zero-copy `AdapterIter<'_>` walks the kernel's linked list in place.
  • BSD routing: replace the O(n²) `results.contains(&addr)` dedup with an O(1) `HashSet<(index, IpAddr)>` so large routing tables scale linearly.
  • Linux: drop the per-line `MediumVec<&str>` allocation in `/proc/net/igmp` and `/proc/net/igmp6` parsing — walk the whitespace-separated iterator directly.
  • Linux: switch `ifindex_to_name` to `rustix::net::netdevice::index_to_name_inlined` (rustix 1.1). The returned stack-allocated `InlinedName` combined with `SmolStr`'s inline-up-to-23-bytes optimization makes the call allocation-free on the happy path.
  • Extract a shared `adapter_index` helper on Windows, deduplicating three copies of the LUID→index resolution block.

Chore

  • MSRV bumped from 1.63.0 to 1.64.0.
  • Bump `rustix` requirement from 1 to 1.1 (required for `index_to_name_inlined`).
  • Bump `smallvec-wrapper` requirement from 0.3 to 0.4.
  • Bump `criterion` dev-dependency from 0.7 to 0.8.
  • Drop the unused `either` dependency (was declared both at the top level and under the Linux-specific target).

See CHANGELOG.md for the full history. Install: `getifs = "0.5"`.

Changelog

Sourced from getifs's changelog.

0.6.1 (May 26th, 2026)

Adds Android as a supported platform. The autobind change in the netlink-socket setup applies to every Linux target as well — the socket's end state is identical and one syscall is saved per call — and two netlink-error-handling fixes in netlink_interface / netlink_addr benefit all Linux callers. The public API is unchanged on every platform, so this is a patch bump.

Android — new platform support

Apps in Android's untrusted_app SELinux domain face two restrictions that previously kept getifs from running there. Both are handled transparently:

  • bind() on netlink_route_socket is denied (Android bug b/155595000). Handle::new() no longer issues an explicit bind — the kernel auto-binds a unique port id on the first sendto(), and that path bypasses the SELinux bind hook (the same path getifaddrs() and Go's net package rely on). The change is unconditional (Linux too); the socket's end state is identical, one syscall is saved per call, and Linux behaviour is unchanged.
  • RTM_GETLINK is denied for apps targeting API level 30+ (it requires the nlmsg_readpriv SELinux permission, neverallowed for untrusted_app). On Android the interface table falls back, on PermissionDenied, to discovering interface indices via RTM_GETADDR (which stays permitted) and reading name / MTU / flags with SIOCGIFNAME / SIOCGIFMTU / SIOCGIFFLAGS / SIOCGIFINDEX ioctls on a datagram socket — bionic-getifaddrs-style. The fallback uses rustix end-to-end (no libc, no getifaddrs). Older Android / app domains that still permit RTM_GETLINK keep the richer netlink result (including the MAC address).

Documented caveats on Android 11+ (API level 30+):

  • interfaces() lists only interfaces that currently have an address — there is no app-permitted way to enumerate address-less ones without getifaddrs. interface_by_index() / interface_by_name() go straight to the ioctl path and are unaffected.
  • Interface::mac_addr() is None (Android restricts the hardware address for apps).
  • Interfaces with a non-UTF-8 name are skipped — one bad name no longer aborts the whole enumeration.
  • interface_multicast_* returns ErrorKind::Unsupported — /proc/net is not readable by apps on Android 10+ (mirrors the existing DragonFly multicast stub).
  • The ioctl socket requires android.permission.INTERNET (which any

... (truncated)

Commits

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

@dependabot dependabot Bot added dependencies Pull requests that update a dependency file rust Pull requests that update rust code labels May 28, 2026
@lance0
lance0 merged commit 7cc4f1a into master Jun 10, 2026
6 checks passed
@dependabot
dependabot Bot deleted the dependabot/cargo/getifs-0.6.1 branch June 10, 2026 18:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file rust Pull requests that update rust code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant