16 Commits

Author SHA1 Message Date
Steven Allen
03e871bdbe fix loopback/link-local checks
1. Ensure we check the entire addr, not just a prefix.
2. Make the LinkLocal test skip zones.
3. Consider link-local multicast to be link-local.
4. Defer to *go* to determine if something is, in fact, a loopback/link-local address.
2018-10-17 22:01:57 +01:00
Steven Allen
5d0dbe0fb9 fix IsIPLoopback comment 2018-09-30 17:16:44 -07:00
Steven Allen
f3041fd8a9 fix loopback addresses
* fe80::1 is not a loopback address
* ::ffff:127.* probably is (IPv4-mapped IPv6)
2018-09-30 16:33:41 -07:00
Steven Allen
ef7ebf9dd8 rename, comment, and move loopback prefixes
Helps readers understand what they're looking at.
2018-03-08 13:34:36 -08:00
Steven Allen
9d1c543b50 Make the IP loopback check faster
Decapsulate currently allocates a lot and this appears to have been causing some
issues (hard to tell, pprof is misbehaving).

Note: I removed the TODO as this function now *only* checks if we're dealing
with a loopback address. Not sure what `OverIPLoopback` was supposed to mean.

Note 2: Decapsulate actually checked if the IP6 loopback addresses
appeared *anywhere* in the multiadder. However, as we weren't doing this for
IP4, I decided to simplify this and only check prefixes.
2018-03-08 12:52:30 -08:00
Jakub Sztandera
a7b93d1185 Merge pull request #27 from jackkleeman/patch-1
Check for local ip6 addresses with more flexbility
2017-03-28 18:08:41 +02:00
Jack Kleeman
ee4ab58778 Check for local ip6 addresses with more flexbility
Currently IsIPLoopback returns true for any multiaddr starting ip4/127, but only returns true on ip6 addresses that exactly equal ip6/::1. So /ip6/::1/tcp/4001 for example does not return true. Instead we should check whether ip6/::1 is contained in the multiaddr, and to do that I simply decapsulated and checked to see if the result is different. It seems this was not caught by tests as none are present specifically for this function.
2017-03-26 13:33:16 +01:00
Hector Sanjuan
1c4b9a62de README/docs: Improved README, make golint happy
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2017-03-17 15:36:06 +01:00
jbenet
4cc9fd0c58 go-multiaddr is now at multiformats org 2016-09-19 10:30:07 +08:00
Jeromy
4d7e08bab8 move deps from godep to gx 2016-04-26 17:11:49 -07:00
Juan Batiz-Benet
98f07b6bcc added todo 2015-01-20 05:51:55 -08:00
Juan Batiz-Benet
2bb75c7221 fixed link local check 2015-01-12 11:56:57 -08:00
Juan Batiz-Benet
8359bd0b54 fixed consts + test 2015-01-12 11:33:06 -08:00
Jeromy
e97d6f0566 add function to test for link local ipv6 addrs 2015-01-11 18:26:49 +00:00
Juan Batiz-Benet
625fac6e50 update imports to point to vendored repos 2014-11-20 00:55:05 -08:00
Juan Batiz-Benet
107f2157f4 IP unspecified addrs 2014-11-05 02:06:28 -08:00