Skip to content

Commit

Permalink
支持Ping带端口的IP
Browse files Browse the repository at this point in the history
  • Loading branch information
Kisesy committed Jan 9, 2018
1 parent f8620ba commit 2ba3560
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion config.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@
"ScanMode": "quic",

// 如果设置为 ping, VerifyPing 会自动关闭
// 还有 IP 不要带端口...
"Ping": {
"ScanCountPerIP": 1,
"ScanMinRTT": 0,
"ScanMaxRTT": 1000,
"RecordLimit": 10000,
"OutputSeparator": "\r\n",
// 支持带端口的IP
"InputFile": "./iprange_ping.txt",
"OutputFile": "./out_ping.txt",
},
Expand Down
6 changes: 6 additions & 0 deletions iprange.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,12 @@ func splitIP(strline string) []ipaddr.Prefix {
return nil
} else {
// "xxx.xxx.xxx.xxx"
// 如果IP带有端口, 那么就分离端口
if i := strings.LastIndex(strline, ":"); i != -1 {
if c, err := ipaddr.Parse(strline[:i]); err == nil {
return c.List()
}
}
begin = strline
end = strline
}
Expand Down

0 comments on commit 2ba3560

Please sign in to comment.