NULL", __func__)); @@ -2011,13 +2010,13 @@ nd6_cache_lladdr(struct ifnet *ifp, struct in6_addr *from, char *lladdr, lladdr_off); } - IF_AFDATA_WLOCK(ifp); + LLTABLE_LOCK(LLTABLE6(ifp)); LLE_WLOCK(ln); /* Prefer any existing lle over newly-created one */ ln_tmp = nd6_lookup(from, LLE_SF(AF_INET6, LLE_EXCLUSIVE), ifp); if (ln_tmp == NULL) lltable_link_entry(LLTABLE6(ifp), ln); - IF_AFDATA_WUNLOCK(ifp); + LLTABLE_UNLOCK(LLTABLE6(ifp)); if (ln_tmp == NULL) { /* No existing lle, mark as new entry (6,7) */ is_newentry = 1; @@ -2337,7 +2336,7 @@ nd6_get_llentry(struct ifnet *ifp, const struct in6_addr *addr, int family) return (NULL); } - IF_AFDATA_WLOCK(ifp); + LLTABLE_LOCK(LLTABLE6(ifp)); LLE_WLOCK(lle); /* Prefer any existing entry over newly-created one */ lle_tmp = nd6_lookup(addr, LLE_SF(AF_INET6, LLE_EXCLUSIVE), ifp); @@ -2363,7 +2362,7 @@ nd6_get_llentry(struct ifnet *ifp, const struct in6_addr *addr, int family) LLE_WUNLOCK(lle); lle = child_lle; } - IF_AFDATA_WUNLOCK(ifp); + LLTABLE_UNLOCK(LLTABLE6(ifp)); return (lle); } @@ -2610,14 +2609,14 @@ nd6_add_ifa_lle(struct in6_ifaddr *ia) if (ln == NULL) return (ENOBUFS); - IF_AFDATA_WLOCK(ifp); + LLTABLE_LOCK(LLTABLE6(ifp)); LLE_WLOCK(ln); /* Unlink any entry if exists */ ln_tmp = lla_lookup(LLTABLE6(ifp), LLE_SF(AF_INET6, LLE_EXCLUSIVE), dst); if (ln_tmp != NULL) lltable_unlink_entry(LLTABLE6(ifp), ln_tmp); lltable_link_entry(LLTABLE6(ifp), ln); - IF_AFDATA_WUNLOCK(ifp); + LLTABLE_UNLOCK(LLTABLE6(ifp)); if (ln_tmp != NULL) EVENTHANDLER_INVOKE(lle_event, ln_tmp, LLENTRY_EXPIRED); diff --git a/sys/netlink/route/neigh.c b/sys/netlink/route/neigh.c index 9eaaae263254..d3170e7a33ef 100644 --- a/sys/netlink/route/neigh.c +++ b/sys/netlink/route/neigh.c @@ -37,7 +37,6 @@ #include #include -#include #include #include #include @@ -431,7 +430,7 @@ rtnl_handle_newneigh(struct nlmsghdr *hdr, struct nlpcb *nlp, struct nl_pstate * lle->la_expire = attrs.ndaf_next_ts - time_second + time_uptime; /* llentry created, try to insert or update */ - IF_AFDATA_WLOCK(attrs.nda_ifp); + LLTABLE_LOCK(llt); LLE_WLOCK(lle); struct llentry *lle_tmp = lla_lookup(llt, LLE_EXCLUSIVE, attrs.nda_dst); if (lle_tmp != NULL) { @@ -454,7 +453,7 @@ rtnl_handle_newneigh(struct nlmsghdr *hdr, struct nlpcb *nlp, struct nl_pstate * else error = ENOENT; } - IF_AFDATA_WUNLOCK(attrs.nda_ifp); + LLTABLE_UNLOCK(llt); if (error != 0) { /* throw away the newly allocated llentry */