diff --git a/udp/protocol.go b/udp/protocol.go index 513bc7f..f089663 100644 --- a/udp/protocol.go +++ b/udp/protocol.go @@ -126,7 +126,7 @@ func (s *Server) newAnnounce(packet []byte, ip net.IP) (*models.Announce, error) } ipbytes := packet[84:88] - if s.config.AllowIPSpoofing && !bytes.Equal(ipbuf, []byte{0, 0, 0, 0}) { + if s.config.AllowIPSpoofing && !bytes.Equal(ipbytes, []byte{0, 0, 0, 0}) { ip = net.ParseIP(string(ipbytes)) }