Commit e97d6f05 authored by Jeromy's avatar Jeromy

add function to test for link local ipv6 addrs

parent 2b8f3530
......@@ -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 {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment