diff options
author | 2016-11-21 10:56:26 +0000 | |
---|---|---|
committer | 2016-11-21 10:56:26 +0000 | |
commit | 86e6976ca35fd86c95c324bf64379c5daa1161d4 (patch) | |
tree | 7f7c23c3858a2559f1a0bdcb16c5e04e46e217ac | |
parent | Assert that prelist_update() is always called at IPL_SOFTNET. (diff) | |
download | wireguard-openbsd-86e6976ca35fd86c95c324bf64379c5daa1161d4.tar.xz wireguard-openbsd-86e6976ca35fd86c95c324bf64379c5daa1161d4.zip |
Assert that defrtrlist_update() is always called at IPL_SOFTNET.
-rw-r--r-- | sys/netinet6/nd6_rtr.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/sys/netinet6/nd6_rtr.c b/sys/netinet6/nd6_rtr.c index 6083de3f90f..55a0fcd5440 100644 --- a/sys/netinet6/nd6_rtr.c +++ b/sys/netinet6/nd6_rtr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nd6_rtr.c,v 1.150 2016/11/21 10:52:08 mpi Exp $ */ +/* $OpenBSD: nd6_rtr.c,v 1.151 2016/11/21 10:56:26 mpi Exp $ */ /* $KAME: nd6_rtr.c,v 1.97 2001/02/07 11:09:13 itojun Exp $ */ /* @@ -871,7 +871,8 @@ defrtrlist_update(struct nd_defrouter *new) { struct nd_defrouter *dr, *n; struct in6_ifextra *ext = new->ifp->if_afdata[AF_INET6]; - int s = splsoftnet(); + + splsoftassert(IPL_SOFTNET); if ((dr = defrouter_lookup(&new->rtaddr, new->ifp->if_index)) != NULL) { /* entry exists */ @@ -894,7 +895,6 @@ defrtrlist_update(struct nd_defrouter *new) * to sort the entries. */ if (rtpref(new) == oldpref) { - splx(s); return (dr); } @@ -911,7 +911,6 @@ defrtrlist_update(struct nd_defrouter *new) n = dr; goto insert; } - splx(s); return (dr); } @@ -920,19 +919,16 @@ defrtrlist_update(struct nd_defrouter *new) /* flush all possible redirects */ if (new->ifp->if_xflags & IFXF_AUTOCONF6) rt6_flush(&new->rtaddr, new->ifp); - splx(s); return (NULL); } if (ip6_maxifdefrouters >= 0 && ext->ndefrouters >= ip6_maxifdefrouters) { - splx(s); return (NULL); } n = malloc(sizeof(*n), M_IP6NDP, M_NOWAIT | M_ZERO); if (n == NULL) { - splx(s); return (NULL); } *n = *new; @@ -958,8 +954,6 @@ insert: ext->ndefrouters++; - splx(s); - return (n); } |