B
Bryan Richardson
[Note: parts of this message were removed to make it a legal post.]
Hello all,
I'm having a problem with IPAddr, and I'm hoping someone can explain it to
me. I've done the following test, and I get the results shown below.
irb(main):001:0> require 'ipaddr'
=> true
irb(main):002:0> net_1 = IPAddr.new("192.168.0.0/16")
=> #<IPAddr: IPv4:192.168.0.0/255.255.0.0>
irb(main):003:0> net_2 = IPAddr.new("192.168.0.0/24")
=> #<IPAddr: IPv4:192.168.0.0/255.255.255.0>
irb(main):004:0> net_1.include?(net_2)
=> true
irb(main):005:0> net_2.include?(net_1)
=> true
irb(main):006:0>
I understand how net_1 can include net_2, but why does net_2 include
net_1?! Thanks in advance! -- BTR
Hello all,
I'm having a problem with IPAddr, and I'm hoping someone can explain it to
me. I've done the following test, and I get the results shown below.
irb(main):001:0> require 'ipaddr'
=> true
irb(main):002:0> net_1 = IPAddr.new("192.168.0.0/16")
=> #<IPAddr: IPv4:192.168.0.0/255.255.0.0>
irb(main):003:0> net_2 = IPAddr.new("192.168.0.0/24")
=> #<IPAddr: IPv4:192.168.0.0/255.255.255.0>
irb(main):004:0> net_1.include?(net_2)
=> true
irb(main):005:0> net_2.include?(net_1)
=> true
irb(main):006:0>
I understand how net_1 can include net_2, but why does net_2 include
net_1?! Thanks in advance! -- BTR