Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
gitbourahlavignal
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
VIGNAL Nicolas
gitbourahlavignal
Commits
759ab152
Commit
759ab152
authored
14 years ago
by
Julien Ammous
Browse files
Options
Downloads
Patches
Plain Diff
do not consider /32 address as being a network address
parent
10c9350c
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/ipaddress/ipv4.rb
+1
-1
1 addition, 1 deletion
lib/ipaddress/ipv4.rb
test/ipaddress/ipv4_test.rb
+5
-0
5 additions, 0 deletions
test/ipaddress/ipv4_test.rb
with
6 additions
and
1 deletion
lib/ipaddress/ipv4.rb
+
1
−
1
View file @
759ab152
...
...
@@ -311,7 +311,7 @@ module IPAddress;
# #=> true
#
def
network?
@u32
|
@prefix
.
to_u32
==
@prefix
.
to_u32
(
@prefix
<
32
)
&&
(
@u32
|
@prefix
.
to_u32
==
@prefix
.
to_u32
)
end
#
...
...
This diff is collapsed.
Click to expand it.
test/ipaddress/ipv4_test.rb
+
5
−
0
View file @
759ab152
...
...
@@ -144,6 +144,11 @@ class IPv4Test < Test::Unit::TestCase
assert_equal
true
,
@network
.
network?
assert_equal
false
,
@ip
.
network?
end
def
test_one_address_network
network
=
@klass
.
new
(
"172.16.10.1/32"
)
assert_equal
false
,
network
.
network?
end
def
test_method_broadcast
@broadcast
.
each
do
|
addr
,
bcast
|
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment