summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Rodrigues <mikebrodrigues@gmail.com>2015-02-10 10:52:04 -0800
committerMichael Rodrigues <mikebrodrigues@gmail.com>2015-02-10 10:52:04 -0800
commitb5a200a665b94f4169c8bc8f4764fccc8224b69a (patch)
tree0087942235cece00dc045a69c11fd4ba762a4466
parent089b7d30bc7497a6bfe0970fc0b3fa92c41fe61e (diff)
downloadipaddress-b5a200a665b94f4169c8bc8f4764fccc8224b69a.tar.gz
broadcast for /32 now returns self
-rw-r--r--lib/ipaddress/ipv4.rb2
-rw-r--r--test/ipaddress/ipv4_test.rb2
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/ipaddress/ipv4.rb b/lib/ipaddress/ipv4.rb
index 0499003..8e04e8b 100644
--- a/lib/ipaddress/ipv4.rb
+++ b/lib/ipaddress/ipv4.rb
@@ -300,7 +300,7 @@ module IPAddress;
when prefix == 31
self.class.parse_u32(-1, @prefix)
when prefix == 32
- return nil
+ return self
end
end
diff --git a/test/ipaddress/ipv4_test.rb b/test/ipaddress/ipv4_test.rb
index 8343c6e..87de7a5 100644
--- a/test/ipaddress/ipv4_test.rb
+++ b/test/ipaddress/ipv4_test.rb
@@ -45,7 +45,7 @@ class IPv4Test < Test::Unit::TestCase
"192.168.0.0/24" => "192.168.0.255/24",
"192.168.100.4/30" => "192.168.100.7/30",
"192.168.12.3/31" => "255.255.255.255/31",
- "10.0.0.1/32" => nil}
+ "10.0.0.1/32" => "10.0.0.1/32"}
@networks = {
"10.5.4.3/8" => "10.0.0.0/8",