diff options
Diffstat (limited to 'sys/dev/sn')
-rw-r--r-- | sys/dev/sn/if_sn.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/dev/sn/if_sn.c b/sys/dev/sn/if_sn.c index 56fb5e8b56d1..ddfc09990c56 100644 --- a/sys/dev/sn/if_sn.c +++ b/sys/dev/sn/if_sn.c @@ -1410,9 +1410,12 @@ sn_getmcf(struct ifnet *ifp, uint8_t *mcf) bzero(mcf, MCFSZ); + IF_ADDR_LOCK(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { - if (ifma->ifma_addr->sa_family != AF_LINK) + if (ifma->ifma_addr->sa_family != AF_LINK) { + IF_ADDR_UNLOCK(ifp); return 0; + } index = ether_crc32_le(LLADDR((struct sockaddr_dl *) ifma->ifma_addr), ETHER_ADDR_LEN) & 0x3f; index2 = 0; @@ -1423,5 +1426,6 @@ sn_getmcf(struct ifnet *ifp, uint8_t *mcf) } af[index2 >> 3] |= 1 << (index2 & 7); } + IF_ADDR_UNLOCK(ifp); return 1; /* use multicast filter */ } |