Skip to content

[Bug]: network_info_plus Linux getWifiSubmask wrong for /22 #3941

Description

@redge-munch

Platform

Linux Ubuntu

Plugin

network_info_plus

Version

8.2.1

Flutter SDK

3.44.2

Steps to reproduce

Preconditions

  1. Linux Desktop
  2. Wi-Fi on a network whose prefix is not /8, /16 or /24 (I.e. Deco /22 -> mask 255.255.252.0)

Steps

  1. Confirm the real mask from the OS:
ip -4 addr show

Expect something like: inet 192.168.68.x/22 → mask 255.255.252.0.

Run a Flutter Linux app that calls:

final info = NetworkInfo();
print(await info.getWifiIP());
print(await info.getWifiSubmask());

Expected

getWifiSubmask() → 255.255.252.0 (same as /22)

Actual

getWifiSubmask() → 255.255.63.0

Code Sample

final info = NetworkInfo();
print(await info.getWifiIP());
print(await info.getWifiSubmask());

Logs

N/A

Flutter Doctor

flutter doctor -v
[✓] Flutter (Channel stable, 3.44.2, on Ubuntu 26.04 LTS 7.0.0-28-generic, locale en_US.UTF-8) [54ms]
    • Flutter version 3.44.2 on channel stable at /home/redge/fvm/versions/3.44.2
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision c9a6c48423 (7 weeks ago), 2026-06-10 15:52:41 -0700
    • Engine revision 77e2e94772
    • Dart version 3.12.2
    • DevTools version 2.57.0
    • Feature flags: enable-web, enable-linux-desktop, enable-macos-desktop, enable-windows-desktop, enable-android, enable-ios,
      cli-animations, enable-native-assets, enable-swift-package-manager, omit-legacy-version-file, enable-lldb-debugging,
      enable-uiscene-migration

[✗] Android toolchain - develop for Android devices [71ms]
    ✗ Unable to locate Android SDK.
      Install Android Studio from: https://developer.android.com/studio/index.html
      On first launch it will assist you in installing the Android SDK components.
      (or visit https://flutter.dev/to/linux-android-setup for detailed instructions).
      If the Android SDK has been installed to a custom location, please use
      `flutter config --android-sdk` to update to that location.


[✗] Chrome - develop for the web (Cannot find Chrome executable at google-chrome) [20ms]
    ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.

[✓] Linux toolchain - develop for Linux desktop [407ms]
    • Ubuntu clang version 21.1.8 (6ubuntu1)
    • cmake version 4.2.3
    • ninja version 1.13.2
    • pkg-config version 2.5.1
    ! Unable to access driver information using 'eglinfo'.
      It is likely available from your distribution (e.g.: apt install mesa-utils)

[✓] Connected device (1 available) [187ms]
    • Linux (desktop) • linux • linux-x64 • Ubuntu 26.04 LTS 7.0.0-28-generic

[✓] Network resources [823ms]
    • All expected network resources are available.

Checklist before submitting a bug

  • I searched issues in this repository and couldn't find such bug/problem
  • I Google'd a solution and I couldn't find it
  • I searched on StackOverflow for a solution and I couldn't find it
  • I read the README.md file of the plugin
  • I'm using the latest version of the plugin
  • All dependencies are up to date with flutter pub upgrade
  • I did a flutter clean
  • I tried running the example project

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions