diff --git a/multicast.go b/multicast.go index b5b223a..1fc6802 100644 --- a/multicast.go +++ b/multicast.go @@ -5,6 +5,7 @@ import ( "fmt" "math/rand" "net" + "slices" "sync" "time" @@ -207,10 +208,8 @@ func (c *Conn) isQuery(packet gopacket.Packet) bool { } c.mu.Lock() defer c.mu.Unlock() - for _, groupIP := range c.groups { - if igmp.GroupAddress.Equal(groupIP) { - return true - } + if slices.ContainsFunc(c.groups, igmp.GroupAddress.Equal) { + return true } } case *layers.IGMP: