Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
mf
go-multiaddr
Commits
30d77c82
Commit
30d77c82
authored
Jan 11, 2015
by
Juan Batiz-Benet
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2 from whyrusleeping/master
add function to test for link local ipv6 addrs
parents
2b8f3530
e97d6f05
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
ip.go
ip.go
+6
-0
No files found.
ip.go
View file @
30d77c82
...
...
@@ -69,6 +69,12 @@ func IsIPLoopback(m ma.Multiaddr) bool {
return
false
}
// IPV6 Link Local addresses are non routable.
func
IsIPV6LinkLocal
(
m
ma
.
Multiaddr
)
bool
{
b
:=
m
.
Bytes
()
return
bytes
.
HasPrefix
(
b
,
[]
byte
{
41
,
254
,
128
})
}
// IsIPUnspecified returns whether a Multiaddr is am Unspecified IP address
// This means either /ip4/0.0.0.0 or /ip6/::
func
IsIPUnspecified
(
m
ma
.
Multiaddr
)
bool
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment