OSDN Git Service
(root)
/
bytom
/
bytom-spv.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
473d528
)
get public ip ignore the ipv6
author
paladz
<453256728@qq.com>
Mon, 14 May 2018 06:05:50 +0000
(14:05 +0800)
committer
paladz
<453256728@qq.com>
Mon, 14 May 2018 06:05:50 +0000
(14:05 +0800)
p2p/public_ip.go
patch
|
blob
|
history
diff --git
a/p2p/public_ip.go
b/p2p/public_ip.go
index
b8b9603
..
466641b
100644
(file)
--- a/
p2p/public_ip.go
+++ b/
p2p/public_ip.go
@@
-57,7
+57,7
@@
func ipAddress(service string, done chan<- *IpResult) {
}
address := strings.TrimSpace(string(data))
- if
net.ParseIP(address
) != nil {
+ if
ip := net.ParseIP(address); ip != nil && ip.To4(
) != nil {
select {
case done <- &IpResult{true, address}:
return