You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
in the gem code, a /31 network has a network address, a broadcast address and has no host address.
For instance the 1.2.3.4/31 subnet will return 1.2.3.4 as network add, 1.2.3.5 as broadcast and each_host returns immediatly.
My understanding of the RFC 3021 about /31 prefixes is the contrary :
no network, no broadcast and 2 hosts available.
Tested with the following code: require 'ipaddress' net=IPAddress "1.2.3.4/31" puts "network:", net.network puts "hosts:" net.each_host { |host| puts host } puts "broadcast:", net.broadcast
The text was updated successfully, but these errors were encountered:
Hello,
in the gem code, a /31 network has a network address, a broadcast address and has no host address.
For instance the 1.2.3.4/31 subnet will return 1.2.3.4 as network add, 1.2.3.5 as broadcast and each_host returns immediatly.
My understanding of the RFC 3021 about /31 prefixes is the contrary :
no network, no broadcast and 2 hosts available.
Tested with the following code:
require 'ipaddress' net=IPAddress "1.2.3.4/31" puts "network:", net.network puts "hosts:" net.each_host { |host| puts host } puts "broadcast:", net.broadcast
The text was updated successfully, but these errors were encountered: