parent
8e427c4bc7
commit
203248425a
1 changed files with 5 additions and 0 deletions
|
@ -79,6 +79,11 @@ func ParseAnnounce(r *http.Request, realIPHeader string, allowIPSpoofing bool) (
|
|||
return nil, bittorrent.ClientError("failed to parse peer IP address")
|
||||
}
|
||||
|
||||
// Sanitize IPv4 addresses to 4 bytes.
|
||||
if ip := request.Peer.IP.To4(); ip != nil {
|
||||
request.Peer.IP = ip
|
||||
}
|
||||
|
||||
return request, nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue