Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
go-libp2p
Commits
5d72a118
Commit
5d72a118
authored
6 years ago
by
Can ZHANG
Browse files
Options
Download
Email Patches
Plain Diff
Remember observed addresses for wildcard local addresses as well
parent
69ff94d8
punching
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
p2p/protocol/identify/id.go
+12
-0
p2p/protocol/identify/id.go
with
12 additions
and
0 deletions
+12
-0
p2p/protocol/identify/id.go
View file @
5d72a118
...
...
@@ -412,6 +412,18 @@ func (ids *IDService) consumeObservedAddress(observed []byte, c inet.Conn) {
}
func
addrInAddrs
(
a
ma
.
Multiaddr
,
as
[]
ma
.
Multiaddr
)
bool
{
// allow wildcard addresses
if
ip
,
err
:=
a
.
ValueForProtocol
(
ma
.
P_IP4
);
err
==
nil
{
if
parsed
:=
net
.
ParseIP
(
ip
);
parsed
!=
nil
&&
parsed
.
IsUnspecified
()
{
return
true
}
}
if
ip
,
err
:=
a
.
ValueForProtocol
(
ma
.
P_IP6
);
err
==
nil
{
if
parsed
:=
net
.
ParseIP
(
ip
);
parsed
!=
nil
&&
parsed
.
IsUnspecified
()
{
return
true
}
}
for
_
,
b
:=
range
as
{
if
a
.
Equal
(
b
)
{
return
true
...
...
This diff is collapsed.
Click to expand it.
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
Menu
Projects
Groups
Snippets
Help