summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorFrancis Luong (Franco) <franco@definefunk.com>2017-08-29 17:14:41 -0400
committerGitHub <noreply@github.com>2017-08-29 17:14:41 -0400
commit580edc4ae51cc9ce89d1d21acc9305261cf809d2 (patch)
treed18a224154faa746455723c415047473fabc18a6 /lib
parent7f68225cc4a72c00b310c1ecbd6900b193ac2ec6 (diff)
parent2edbae88448d0a6b0ea24a7fe6b39a62073af234 (diff)
downloadipaddress-580edc4ae51cc9ce89d1d21acc9305261cf809d2.tar.gz
Merge pull request #93 from asomers/link_local
Add IPv6#link_local?
Diffstat (limited to 'lib')
-rw-r--r--lib/ipaddress/ipv6.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/ipaddress/ipv6.rb b/lib/ipaddress/ipv6.rb
index 88098bc..6ae651d 100644
--- a/lib/ipaddress/ipv6.rb
+++ b/lib/ipaddress/ipv6.rb
@@ -397,6 +397,13 @@ module IPAddress;
@compressed
end
+ #
+ # Returns true if the address is a link local address
+ #
+ def link_local?
+ @groups[0] == 0xfe80
+ end
+
#
# Returns true if the address is an unspecified address
#