Describe the bug
When retrieving any network interface's netmask it almost always returns 0.0.0.0, which is incorrect.
To Reproduce
A call to Poco::Net::NetworkInterface::subnetMask() with as index default 0 or 1.
Expected behavior
This is expected to return a netmask, like the typical /24 netmask of 255.255.255.0, or 255.0.0.0 on loopback.
Logs
With the default 0 index parameter:
Found 3 network interfaces.
Network interface 'Software Loopback Interface 1'.
Subnet Mask: 0.0.0.0
Broadcast: 255.255.255.255
Broadcast IP address: 255.255.255.255
Sending...
Listening...
Received message with length 205
Network interface 'Realtek PCIe GbE Family Controller'.
Subnet Mask: 0.0.0.0
Broadcast: 255.255.255.255
Broadcast IP address: 255.255.255.255
Sending...
Listening...
Received message with length 205
Network interface 'VirtualBox Host-Only Ethernet Adapter'.
Subnet Mask: 0.0.0.0
Broadcast: 255.255.255.255
Broadcast IP address: 255.255.255.255
When changing the index to 1 two of the three interfaces return the right netmask:
Found 3 network interfaces.
Network interface 'Software Loopback Interface 1'.
Subnet Mask: 255.0.0.0
Broadcast: 255.255.255.255
Broadcast IP address: 127.255.255.255
Sending...
Listening...
Network interface 'Realtek PCIe GbE Family Controller'.
Subnet Mask: 0.0.0.0
Broadcast: 255.255.255.255
Broadcast IP address: 255.255.255.255
Sending...
Listening...
Network interface 'VirtualBox Host-Only Ethernet Adapter'.
Subnet Mask: 255.255.255.0
Broadcast: 255.255.255.255
Broadcast IP address: 192.168.56.255
Screenshots
If applicable, add screenshots to help explain your problem.
Please add relevant environment information:
- OS: Windows 10.
- Current POCO version in the MSYS2 repository, as well as a slightly older version obtained via vcpkg.
- Tests were run within the NyanSD project's codebase, in both MSYS2 with g++ and natively in a Visual Studio 2017 & 2022 shell on two different Windows 10 systems.
Additional context
It's unclear what the meaning of the index parameter is in obtaining the netmask. Previously just the IP address from the default index was used to create a /24 broadcast address from, which works fine. This seems to imply that the IP address exists in multiple records, but the netmask is missing in some records, which is curious.
I haven't tried the same tests on another OS like Linux yet, but this can be done too if necessary.
Describe the bug
When retrieving any network interface's netmask it almost always returns 0.0.0.0, which is incorrect.
To Reproduce
A call to
Poco::Net::NetworkInterface::subnetMask()with as index default0or1.Expected behavior
This is expected to return a netmask, like the typical /24 netmask of 255.255.255.0, or 255.0.0.0 on loopback.
Logs
With the default
0index parameter:When changing the index to
1two of the three interfaces return the right netmask:Screenshots
If applicable, add screenshots to help explain your problem.
Please add relevant environment information:
Additional context
It's unclear what the meaning of the index parameter is in obtaining the netmask. Previously just the IP address from the default index was used to create a /24 broadcast address from, which works fine. This seems to imply that the IP address exists in multiple records, but the netmask is missing in some records, which is curious.
I haven't tried the same tests on another OS like Linux yet, but this can be done too if necessary.