Don't use if_maddr_rlock() in ng_ether(4), use epoch(9) directly instead.

This commit is contained in:
glebius 2019-10-10 23:47:14 +00:00
parent 05b77fd477
commit 1bbf4a3048

View File

@ -578,6 +578,7 @@ ng_ether_rcvmsg(node_p node, item_p item, hook_p lasthook)
case NGM_ETHER_ADD_MULTI:
{
struct sockaddr_dl sa_dl;
struct epoch_tracker et;
struct ifmultiaddr *ifma;
if (msg->header.arglen != ETHER_ADDR_LEN) {
@ -597,10 +598,10 @@ ng_ether_rcvmsg(node_p node, item_p item, hook_p lasthook)
* lose a race while we check if the membership
* already exists.
*/
if_maddr_rlock(priv->ifp);
NET_EPOCH_ENTER(et);
ifma = if_findmulti(priv->ifp,
(struct sockaddr *)&sa_dl);
if_maddr_runlock(priv->ifp);
NET_EPOCH_EXIT(et);
if (ifma != NULL) {
error = EADDRINUSE;
} else {