+ for (i = 0; source_multicast_list[i] != NULL; i++) {
+ if (ifmaddr_address(source_multicast_list[i],
+ (struct sockaddr *)&source_sdl,
+ sizeof(source_sdl)) != 0
+ || source_sdl.sdl_family != AF_LINK) {
+ continue;
+ }
+ mc = _MALLOC(sizeof(struct multicast_entry), M_DEVBUF, M_WAITOK);
+ if (mc == NULL) {
+ error = ENOBUFS;
+ break;
+ }
+ bcopy(LLADDR(&source_sdl), LLADDR(&target_sdl), alen);
+ error = ifnet_add_multicast(target_ifp, (struct sockaddr *)&target_sdl,
+ &mc->mc_ifma);
+ if (error != 0) {
+ FREE(mc, M_DEVBUF);
+ break;
+ }
+ SLIST_INSERT_HEAD(&new_mc_list, mc, mc_entries);