Subnet is returned as 255.255.255.255 instead of 255.255.255.0
See original GitHub issueEnvironment
System:
OS: Linux 5.18 Debian GNU/Linux 11 (bullseye) 11 (bullseye)
CPU: (16) x64 12th Gen Intel(R) Core(TM) i5-12600K
Memory: 13.71 GB / 31.11 GB
Shell: 5.1.4 - /bin/bash
Binaries:
Node: 16.18.0 - /usr/bin/node
Yarn: 1.22.17 - /usr/local/bin/yarn
npm: 8.19.2 - /usr/bin/npm
Watchman: Not Found
SDKs:
Android SDK: Not Found
IDEs:
Android Studio: Not Found
Languages:
Java: 17.0.4 - /usr/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: 17.0.2 => 17.0.2
react-native: 0.67.4 => 0.67.4
npmGlobalPackages:
*react-native*: Not Found
Platforms
Android 11
Versions
- Android: 11 (8901.4.A.0017.3 release-keys)
- react-native-netinfo: 9.3.4
- react-native: 0.67.4
- react: 17.0.2
Description
On my Android 11 device (Fairphone 3+) running NetInfo.fetch
gives correct information, aside from subnet
:
[{"details":{"isConnectionExpensive":false,"txLinkSpeed":57,"rxLinkSpeed":-1,"linkSpeed":57,"subnet":"255.255.255.255","ipAddress":"10.0.0.133","frequency":2462,"strength":72,"bssid":"xxx","ssid":"xxx"},"isConnected":true,"type":"wifi","isInternetReachable":true,"isWifiEnabled":true}]
The correct network information would be 10.0.0.133/24
, i.e. a subnet of 255.255.255.0
. On my desktop machine (in the same network) I see
inet 10.0.0.2/24 brd 10.0.0.255 scope global dynamic noprefixroute eno1
valid_lft 860383sec preferred_lft 860383sec
When checking the network details manully (long-pressing on the Wifi icon) I also get a subnet mask of 255.255.255.0
.
Issue Analytics
- State:
- Created a year ago
- Comments:6 (5 by maintainers)
Top Results From Across the Web
Change subnet mask from 255.255.255.0 to ... - Super User
If your device lets you enter 255.255.255.255 as the subnet mask it won't be able to communicate with other devices on the network....
Read more >What is a 255.255 255.0 subnet? - Quora
It means the first 24 bits of the IP address are the network or subnet portion of the address, and the last 8...
Read more >255.255.255.0 Subnet Mask for IP Networks - Lifewire
The subnet mask 255.255.255.0 address is the most common subnet mask used on computers connected to Internet Protocol (IPv4) networks.
Read more >Understanding 255.255.255.0 : r/linuxquestions - Reddit
255.255.255.0 tells you that in your subnet (=part of the global IPv4 network), the first three parts of the network address always stay...
Read more >Subnets and IP addresses - Router Security
A subnet mask of 255.255.255.0 is actually 24 binary ones, followed by 8 binary zeros. For this reason, you often see it referred...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You win the internet points for the day for nailing this with what appears to be a squeaky clean PR. Chapeau
It’s open source, it’s your code 😆
If there’s something that needs to change I’m open to any+all reasonable PRs
This module existed long before I had heard of react-native, and it’ll be here long after I’ve stopped hitting the “merge” button, I imagine you are correct and it’s just IPv4-only at the moment, or incorrectly-IPv6