]> git.saurik.com Git - apple/xnu.git/blobdiff - bsd/netinet6/in6_mcast.c
xnu-3789.70.16.tar.gz
[apple/xnu.git] / bsd / netinet6 / in6_mcast.c
index dd27747f73bfd91af84f0fdbe0dce675b93fcf02..1fc7aca0342b8aef1c8da97cb2a5fe29c741b51f 100644 (file)
@@ -2470,6 +2470,8 @@ in6p_leave_group(struct inpcb *inp, struct sockopt *sopt)
                            ip6_sprintf(&gsa->sin6.sin6_addr)));
                        ifp = in6p_lookup_mcast_ifp(inp, &gsa->sin6);
                } else {
+                       if (!IF_INDEX_IN_RANGE(ifindex))
+                               return (EADDRNOTAVAIL);
                        ifnet_head_lock_shared();
                        ifp = ifindex2ifnet[ifindex];
                        ifnet_head_done();