Author SHA1 Message Date
Artёm Mishin 1c8dd338f8 fix: connection address resolution
release / release (push) Successful in 39s
2024-02-03 08:11:18 +03:00
2 changed files with 8 additions and 1 deletions

No files matched your search

+1
View File
@@ -16,6 +16,7 @@ jobs:
uses: https://github.com/actions/setup-go@v4
with:
go-version: '>=1.20.1'
cache: false
- name: release-build
run: go build -ldflags="-s -w -X 'main.Version=${{ github.ref_name }}'" -o bin/honeyspot-${{ github.ref_name }}-linux-amd64
- name: release-build-windows
+7 -1
View File
@@ -409,7 +409,13 @@ func listen(addr string) {
}
// check is ip
ip := net.ParseIP(remoteAddr.String())
remoteAddrStr := remoteAddr.String()
// remove port with IPv6 support
if strings.Contains(remoteAddrStr, ":") {
remoteAddrStr = remoteAddrStr[:strings.LastIndex(remoteAddrStr, ":")]
}
ip := net.ParseIP(remoteAddrStr)
if ip == nil {
log.Warnf("Got request from non-IP %s, ignoring request", remoteAddr)
_ = conn.Close()