summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormpi <mpi@openbsd.org>2017-05-16 12:24:01 +0000
committermpi <mpi@openbsd.org>2017-05-16 12:24:01 +0000
commit66736630cee42b00f38c44e0b154c35b7ac24eca (patch)
tree83ed1b4834be42ab64e887f18456be7d7163f9c2
parentRemove list member now that the global list is gone. (diff)
downloadwireguard-openbsd-66736630cee42b00f38c44e0b154c35b7ac24eca.tar.xz
wireguard-openbsd-66736630cee42b00f38c44e0b154c35b7ac24eca.zip
Replace remaining splsoftassert(IPL_SOFTNET) by NET_ASSERT_LOCKED().
ok visa@
-rw-r--r--sys/net/bfd.c4
-rw-r--r--sys/net/bridgestp.c4
-rw-r--r--sys/net/if.c12
-rw-r--r--sys/net/if_bridge.c4
-rw-r--r--sys/net/if_pfsync.c18
-rw-r--r--sys/net/if_ppp.c4
-rw-r--r--sys/net/if_pppoe.c4
-rw-r--r--sys/net/pf.c6
-rw-r--r--sys/net/pf_if.c4
-rw-r--r--sys/net/pfkey.c4
-rw-r--r--sys/net/pfkeyv2.c8
-rw-r--r--sys/net/route.c8
-rw-r--r--sys/netinet/igmp.c8
-rw-r--r--sys/netinet/in.c12
-rw-r--r--sys/netinet/ip_input.c4
-rw-r--r--sys/netinet/ip_ipsp.c14
-rw-r--r--sys/netinet/ip_mroute.c12
-rw-r--r--sys/netinet/ipsec_input.c6
-rw-r--r--sys/netinet/ipsec_output.c4
-rw-r--r--sys/netinet/tcp_timer.c4
-rw-r--r--sys/netinet/tcp_usrreq.c4
-rw-r--r--sys/netinet6/frag6.c4
-rw-r--r--sys/netinet6/in6.c12
-rw-r--r--sys/netinet6/in6_ifattach.c4
-rw-r--r--sys/netinet6/ip6_mroute.c14
-rw-r--r--sys/netinet6/mld6.c4
-rw-r--r--sys/netinet6/nd6.c8
-rw-r--r--sys/netinet6/nd6_nbr.c6
-rw-r--r--sys/netinet6/nd6_rtr.c18
29 files changed, 108 insertions, 110 deletions
diff --git a/sys/net/bfd.c b/sys/net/bfd.c
index 560bab52728..26f487555de 100644
--- a/sys/net/bfd.c
+++ b/sys/net/bfd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bfd.c,v 1.61 2017/03/10 02:12:46 phessler Exp $ */
+/* $OpenBSD: bfd.c,v 1.62 2017/05/16 12:24:01 mpi Exp $ */
/*
* Copyright (c) 2016 Peter Hessler <phessler@openbsd.org>
@@ -236,8 +236,6 @@ bfd_clear_task(void *arg)
struct rtentry *rt = (struct rtentry *)arg;
struct bfd_config *bfd;
- splsoftassert(IPL_SOFTNET);
-
if ((bfd = bfd_lookup(rt)) == NULL)
return;
diff --git a/sys/net/bridgestp.c b/sys/net/bridgestp.c
index dec7b86836c..35e31ea643e 100644
--- a/sys/net/bridgestp.c
+++ b/sys/net/bridgestp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bridgestp.c,v 1.64 2017/01/24 10:08:30 krw Exp $ */
+/* $OpenBSD: bridgestp.c,v 1.65 2017/05/16 12:24:01 mpi Exp $ */
/*
* Copyright (c) 2000 Jason L. Wright (jason@thought.net)
@@ -1584,7 +1584,7 @@ bstp_notify_rtage(struct bstp_port *bp, int pending)
{
int age = 0;
- splsoftassert(IPL_SOFTNET);
+ NET_ASSERT_LOCKED();
switch (bp->bp_protover) {
case BSTP_PROTO_STP:
diff --git a/sys/net/if.c b/sys/net/if.c
index 9d03d8a1d2e..34fd1aa84d7 100644
--- a/sys/net/if.c
+++ b/sys/net/if.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if.c,v 1.496 2017/05/15 12:26:00 mpi Exp $ */
+/* $OpenBSD: if.c,v 1.497 2017/05/16 12:24:01 mpi Exp $ */
/* $NetBSD: if.c,v 1.35 1996/05/07 05:26:04 thorpej Exp $ */
/*
@@ -410,7 +410,7 @@ if_attachsetup(struct ifnet *ifp)
{
unsigned long ifidx;
- splsoftassert(IPL_SOFTNET);
+ NET_ASSERT_LOCKED();
TAILQ_INIT(&ifp->if_groups);
@@ -1143,7 +1143,7 @@ if_clone_create(const char *name, int rdomain)
struct ifnet *ifp;
int unit, ret;
- splsoftassert(IPL_SOFTNET);
+ NET_ASSERT_LOCKED();
ifc = if_clone_lookup(name, &unit);
if (ifc == NULL)
@@ -1177,7 +1177,7 @@ if_clone_destroy(const char *name)
struct ifnet *ifp;
int ret;
- splsoftassert(IPL_SOFTNET);
+ NET_ASSERT_LOCKED();
ifc = if_clone_lookup(name, NULL);
if (ifc == NULL)
@@ -1516,7 +1516,7 @@ if_downall(void)
void
if_down(struct ifnet *ifp)
{
- splsoftassert(IPL_SOFTNET);
+ NET_ASSERT_LOCKED();
ifp->if_flags &= ~IFF_UP;
getmicrotime(&ifp->if_lastchange);
@@ -1532,7 +1532,7 @@ if_down(struct ifnet *ifp)
void
if_up(struct ifnet *ifp)
{
- splsoftassert(IPL_SOFTNET);
+ NET_ASSERT_LOCKED();
ifp->if_flags |= IFF_UP;
getmicrotime(&ifp->if_lastchange);
diff --git a/sys/net/if_bridge.c b/sys/net/if_bridge.c
index cf6f4325f8a..0e048205475 100644
--- a/sys/net/if_bridge.c
+++ b/sys/net/if_bridge.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_bridge.c,v 1.296 2017/05/15 12:57:42 mpi Exp $ */
+/* $OpenBSD: if_bridge.c,v 1.297 2017/05/16 12:24:01 mpi Exp $ */
/*
* Copyright (c) 1999, 2000 Jason L. Wright (jason@thought.net)
@@ -1467,7 +1467,7 @@ bridge_ipsec(struct bridge_softc *sc, struct ifnet *ifp,
break;
}
- splsoftassert(IPL_SOFTNET);
+ NET_ASSERT_LOCKED();
tdb = gettdb(ifp->if_rdomain, spi, &dst, proto);
if (tdb != NULL && (tdb->tdb_flags & TDBF_INVALID) == 0 &&
diff --git a/sys/net/if_pfsync.c b/sys/net/if_pfsync.c
index 9a1f3c44589..ff1f3d9dcd1 100644
--- a/sys/net/if_pfsync.c
+++ b/sys/net/if_pfsync.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_pfsync.c,v 1.250 2017/04/14 20:46:31 bluhm Exp $ */
+/* $OpenBSD: if_pfsync.c,v 1.251 2017/05/16 12:24:01 mpi Exp $ */
/*
* Copyright (c) 2002 Michael Shalayeff
@@ -1180,7 +1180,7 @@ pfsync_update_net_tdb(struct pfsync_tdb *pt)
{
struct tdb *tdb;
- splsoftassert(IPL_SOFTNET);
+ NET_ASSERT_LOCKED();
/* check for invalid values */
if (ntohl(pt->spi) <= SPI_RESERVED_MAX ||
@@ -1686,7 +1686,7 @@ pfsync_insert_state(struct pf_state *st)
{
struct pfsync_softc *sc = pfsyncif;
- splsoftassert(IPL_SOFTNET);
+ NET_ASSERT_LOCKED();
if (ISSET(st->rule.ptr->rule_flag, PFRULE_NOSYNC) ||
st->key[PF_SK_WIRE]->proto == IPPROTO_PFSYNC) {
@@ -1716,7 +1716,7 @@ pfsync_defer(struct pf_state *st, struct mbuf *m)
struct pfsync_softc *sc = pfsyncif;
struct pfsync_deferral *pd;
- splsoftassert(IPL_SOFTNET);
+ NET_ASSERT_LOCKED();
if (!sc->sc_defer ||
ISSET(st->state_flags, PFSTATE_NOSYNC) ||
@@ -1756,7 +1756,7 @@ pfsync_undefer(struct pfsync_deferral *pd, int drop)
struct pfsync_softc *sc = pfsyncif;
struct pf_pdesc pdesc;
- splsoftassert(IPL_SOFTNET);
+ NET_ASSERT_LOCKED();
TAILQ_REMOVE(&sc->sc_deferrals, pd, pd_entry);
sc->sc_deferred--;
@@ -1821,7 +1821,7 @@ pfsync_deferred(struct pf_state *st, int drop)
struct pfsync_softc *sc = pfsyncif;
struct pfsync_deferral *pd;
- splsoftassert(IPL_SOFTNET);
+ NET_ASSERT_LOCKED();
TAILQ_FOREACH(pd, &sc->sc_deferrals, pd_entry) {
if (pd->pd_st == st) {
@@ -1840,7 +1840,7 @@ pfsync_update_state(struct pf_state *st)
struct pfsync_softc *sc = pfsyncif;
int sync = 0;
- splsoftassert(IPL_SOFTNET);
+ NET_ASSERT_LOCKED();
if (sc == NULL || !ISSET(sc->sc_if.if_flags, IFF_RUNNING))
return;
@@ -2009,7 +2009,7 @@ pfsync_delete_state(struct pf_state *st)
{
struct pfsync_softc *sc = pfsyncif;
- splsoftassert(IPL_SOFTNET);
+ NET_ASSERT_LOCKED();
if (sc == NULL || !ISSET(sc->sc_if.if_flags, IFF_RUNNING))
return;
@@ -2056,7 +2056,7 @@ pfsync_clear_states(u_int32_t creatorid, const char *ifname)
struct pfsync_clr clr;
} __packed r;
- splsoftassert(IPL_SOFTNET);
+ NET_ASSERT_LOCKED();
if (sc == NULL || !ISSET(sc->sc_if.if_flags, IFF_RUNNING))
return;
diff --git a/sys/net/if_ppp.c b/sys/net/if_ppp.c
index e8444a42ab7..0bd9c993d31 100644
--- a/sys/net/if_ppp.c
+++ b/sys/net/if_ppp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_ppp.c,v 1.105 2017/03/08 11:35:34 mpi Exp $ */
+/* $OpenBSD: if_ppp.c,v 1.106 2017/05/16 12:24:01 mpi Exp $ */
/* $NetBSD: if_ppp.c,v 1.39 1997/05/17 21:11:59 christos Exp $ */
/*
@@ -992,7 +992,7 @@ pppintr(void)
struct ppp_pkt *pkt;
struct mbuf *m;
- splsoftassert(IPL_SOFTNET);
+ NET_ASSERT_LOCKED();
LIST_FOREACH(sc, &ppp_softc_list, sc_list) {
if (!(sc->sc_flags & SC_TBUSY) &&
diff --git a/sys/net/if_pppoe.c b/sys/net/if_pppoe.c
index 51a7b5746b4..a81121aa578 100644
--- a/sys/net/if_pppoe.c
+++ b/sys/net/if_pppoe.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_pppoe.c,v 1.60 2017/01/22 10:17:39 dlg Exp $ */
+/* $OpenBSD: if_pppoe.c,v 1.61 2017/05/16 12:24:01 mpi Exp $ */
/* $NetBSD: if_pppoe.c,v 1.51 2003/11/28 08:56:48 keihan Exp $ */
/*
@@ -344,7 +344,7 @@ pppoeintr(void)
{
struct mbuf *m;
- splsoftassert(IPL_SOFTNET);
+ NET_ASSERT_LOCKED();
while ((m = niq_dequeue(&pppoediscinq)) != NULL)
pppoe_disc_input(m);
diff --git a/sys/net/pf.c b/sys/net/pf.c
index 32493720291..f26e5e3f106 100644
--- a/sys/net/pf.c
+++ b/sys/net/pf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pf.c,v 1.1022 2017/05/15 12:26:00 mpi Exp $ */
+/* $OpenBSD: pf.c,v 1.1023 2017/05/16 12:24:01 mpi Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
@@ -895,7 +895,7 @@ int
pf_state_insert(struct pfi_kif *kif, struct pf_state_key **skw,
struct pf_state_key **sks, struct pf_state *s)
{
- splsoftassert(IPL_SOFTNET);
+ NET_ASSERT_LOCKED();
s->kif = kif;
if (*skw == *sks) {
@@ -1275,7 +1275,7 @@ pf_src_tree_remove_state(struct pf_state *s)
void
pf_remove_state(struct pf_state *cur)
{
- splsoftassert(IPL_SOFTNET);
+ NET_ASSERT_LOCKED();
/* handle load balancing related tasks */
pf_postprocess_addr(cur);
diff --git a/sys/net/pf_if.c b/sys/net/pf_if.c
index 5069e85519a..c2538cece2d 100644
--- a/sys/net/pf_if.c
+++ b/sys/net/pf_if.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pf_if.c,v 1.89 2017/01/24 10:08:30 krw Exp $ */
+/* $OpenBSD: pf_if.c,v 1.90 2017/05/16 12:24:01 mpi Exp $ */
/*
* Copyright 2005 Henning Brauer <henning@openbsd.org>
@@ -594,7 +594,7 @@ pfi_kifaddr_update(void *v)
{
struct pfi_kif *kif = (struct pfi_kif *)v;
- splsoftassert(IPL_SOFTNET);
+ NET_ASSERT_LOCKED();
pfi_update++;
pfi_kif_update(kif);
diff --git a/sys/net/pfkey.c b/sys/net/pfkey.c
index 0f77d2d8654..400485ddc98 100644
--- a/sys/net/pfkey.c
+++ b/sys/net/pfkey.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pfkey.c,v 1.40 2017/03/13 20:18:21 claudio Exp $ */
+/* $OpenBSD: pfkey.c,v 1.41 2017/05/16 12:24:01 mpi Exp $ */
/*
* @(#)COPYRIGHT 1.1 (NRL) 17 January 1995
@@ -137,7 +137,7 @@ pfkey_sendup(struct socket *socket, struct mbuf *packet, int more)
{
struct mbuf *packet2;
- splsoftassert(IPL_SOFTNET);
+ NET_ASSERT_LOCKED();
if (more) {
if (!(packet2 = m_dup_pkt(packet, 0, M_DONTWAIT)))
diff --git a/sys/net/pfkeyv2.c b/sys/net/pfkeyv2.c
index b56010365dd..46adb038eec 100644
--- a/sys/net/pfkeyv2.c
+++ b/sys/net/pfkeyv2.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pfkeyv2.c,v 1.154 2017/05/05 11:04:18 bluhm Exp $ */
+/* $OpenBSD: pfkeyv2.c,v 1.155 2017/05/16 12:24:01 mpi Exp $ */
/*
* @(#)COPYRIGHT 1.1 (NRL) 17 January 1995
@@ -823,7 +823,7 @@ pfkeyv2_send(struct socket *socket, void *message, int len)
u_int rdomain;
- splsoftassert(IPL_SOFTNET);
+ NET_ASSERT_LOCKED();
/* Verify that we received this over a legitimate pfkeyv2 socket */
bzero(headers, sizeof(headers));
@@ -2168,7 +2168,7 @@ pfkeyv2_ipo_walk(u_int rdomain, int (*walker)(struct ipsec_policy *, void *),
int rval = 0;
struct ipsec_policy *ipo;
- splsoftassert(IPL_SOFTNET);
+ NET_ASSERT_LOCKED();
TAILQ_FOREACH(ipo, &ipsec_policy_head, ipo_list) {
if (ipo->ipo_rdomain != rdomain)
@@ -2245,7 +2245,7 @@ pfkeyv2_sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp,
int error = EINVAL;
u_int rdomain;
- splsoftassert(IPL_SOFTNET);
+ NET_ASSERT_LOCKED();
if (new)
return (EPERM);
diff --git a/sys/net/route.c b/sys/net/route.c
index ffa4baa21f1..fe2d39d4d62 100644
--- a/sys/net/route.c
+++ b/sys/net/route.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: route.c,v 1.355 2017/04/19 15:21:54 bluhm Exp $ */
+/* $OpenBSD: route.c,v 1.356 2017/05/16 12:24:01 mpi Exp $ */
/* $NetBSD: route.c,v 1.14 1996/02/13 22:00:46 christos Exp $ */
/*
@@ -241,7 +241,7 @@ rt_match(struct sockaddr *dst, uint32_t *src, int flags, unsigned int tableid)
struct rtentry *rt0, *rt = NULL;
int error = 0;
- splsoftassert(IPL_SOFTNET);
+ NET_ASSERT_LOCKED();
rt = rtable_match(tableid, dst, src);
if (rt != NULL) {
@@ -833,7 +833,7 @@ rtrequest_delete(struct rt_addrinfo *info, u_int8_t prio, struct ifnet *ifp,
struct rtentry *rt;
int error;
- splsoftassert(IPL_SOFTNET);
+ NET_ASSERT_LOCKED();
if (!rtable_exists(tableid))
return (EAFNOSUPPORT);
@@ -920,7 +920,7 @@ rtrequest(int req, struct rt_addrinfo *info, u_int8_t prio,
struct sockaddr_mpls *sa_mpls;
#endif
- splsoftassert(IPL_SOFTNET);
+ NET_ASSERT_LOCKED();
if (!rtable_exists(tableid))
return (EAFNOSUPPORT);
diff --git a/sys/netinet/igmp.c b/sys/netinet/igmp.c
index 12b9561b0ec..ed7bba46a7d 100644
--- a/sys/netinet/igmp.c
+++ b/sys/netinet/igmp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: igmp.c,v 1.67 2017/05/04 17:58:46 bluhm Exp $ */
+/* $OpenBSD: igmp.c,v 1.68 2017/05/16 12:24:01 mpi Exp $ */
/* $NetBSD: igmp.c,v 1.15 1996/02/13 23:41:25 christos Exp $ */
/*
@@ -550,7 +550,7 @@ igmp_fasttimo(void)
{
struct ifnet *ifp;
- splsoftassert(IPL_SOFTNET);
+ NET_ASSERT_LOCKED();
/*
* Quick check to see if any work needs to be done, in order
@@ -571,7 +571,7 @@ igmp_checktimer(struct ifnet *ifp)
struct in_multi *inm;
struct ifmaddr *ifma;
- splsoftassert(IPL_SOFTNET);
+ NET_ASSERT_LOCKED();
TAILQ_FOREACH(ifma, &ifp->if_maddrlist, ifma_list) {
if (ifma->ifma_addr->sa_family != AF_INET)
@@ -600,7 +600,7 @@ igmp_slowtimo(void)
{
struct router_info *rti;
- splsoftassert(IPL_SOFTNET);
+ NET_ASSERT_LOCKED();
for (rti = rti_head; rti != 0; rti = rti->rti_next) {
if (rti->rti_type == IGMP_v1_ROUTER &&
diff --git a/sys/netinet/in.c b/sys/netinet/in.c
index 7a20e768887..e2f0ed59b7b 100644
--- a/sys/netinet/in.c
+++ b/sys/netinet/in.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: in.c,v 1.137 2017/05/04 15:00:24 bluhm Exp $ */
+/* $OpenBSD: in.c,v 1.138 2017/05/16 12:24:01 mpi Exp $ */
/* $NetBSD: in.c,v 1.26 1996/02/13 23:41:39 christos Exp $ */
/*
@@ -210,7 +210,7 @@ in_ioctl(u_long cmd, caddr_t data, struct ifnet *ifp, int privileged)
int error;
int newifaddr;
- splsoftassert(IPL_SOFTNET);
+ NET_ASSERT_LOCKED();
TAILQ_FOREACH(ifa, &ifp->if_addrlist, ifa_list) {
if (ifa->ifa_addr->sa_family == AF_INET) {
@@ -600,7 +600,7 @@ in_ifinit(struct ifnet *ifp, struct in_ifaddr *ia, struct sockaddr_in *sin,
struct sockaddr_in oldaddr;
int error = 0, rterror;
- splsoftassert(IPL_SOFTNET);
+ NET_ASSERT_LOCKED();
/*
* Always remove the address from the tree to make sure its
@@ -700,7 +700,7 @@ in_purgeaddr(struct ifaddr *ifa)
struct in_ifaddr *ia = ifatoia(ifa);
extern int ifatrash;
- splsoftassert(IPL_SOFTNET);
+ NET_ASSERT_LOCKED();
in_ifscrub(ifp, ia);
@@ -798,7 +798,7 @@ in_addmulti(struct in_addr *ap, struct ifnet *ifp)
struct in_multi *inm;
struct ifreq ifr;
- splsoftassert(IPL_SOFTNET);
+ NET_ASSERT_LOCKED();
/*
* See if address already in list.
@@ -860,7 +860,7 @@ in_delmulti(struct in_multi *inm)
struct ifreq ifr;
struct ifnet *ifp;
- splsoftassert(IPL_SOFTNET);
+ NET_ASSERT_LOCKED();
if (--inm->inm_refcnt == 0) {
/*
diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c
index 780190950cc..cb27fcede64 100644
--- a/sys/netinet/ip_input.c
+++ b/sys/netinet/ip_input.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_input.c,v 1.301 2017/05/12 23:05:58 bluhm Exp $ */
+/* $OpenBSD: ip_input.c,v 1.302 2017/05/16 12:24:01 mpi Exp $ */
/* $NetBSD: ip_input.c,v 1.30 1996/03/16 23:53:58 christos Exp $ */
/*
@@ -987,7 +987,7 @@ ip_slowtimo(void)
{
struct ipq *fp, *nfp;
- splsoftassert(IPL_SOFTNET);
+ NET_ASSERT_LOCKED();
for (fp = LIST_FIRST(&ipq); fp != NULL; fp = nfp) {
nfp = LIST_NEXT(fp, ipq_q);
diff --git a/sys/netinet/ip_ipsp.c b/sys/netinet/ip_ipsp.c
index dd252568ffa..9a5ec57a725 100644
--- a/sys/netinet/ip_ipsp.c
+++ b/sys/netinet/ip_ipsp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_ipsp.c,v 1.222 2017/05/06 15:55:15 bluhm Exp $ */
+/* $OpenBSD: ip_ipsp.c,v 1.223 2017/05/16 12:24:01 mpi Exp $ */
/*
* The authors of this code are John Ioannidis (ji@tla.org),
* Angelos D. Keromytis (kermit@csd.uch.gr),
@@ -211,7 +211,7 @@ reserve_spi(u_int rdomain, u_int32_t sspi, u_int32_t tspi,
u_int32_t spi;
int nums;
- splsoftassert(IPL_SOFTNET);
+ NET_ASSERT_LOCKED();
/* Don't accept ranges only encompassing reserved SPIs. */
if (sproto != IPPROTO_IPCOMP &&
@@ -306,7 +306,7 @@ gettdb(u_int rdomain, u_int32_t spi, union sockaddr_union *dst, u_int8_t proto)
u_int32_t hashval;
struct tdb *tdbp;
- splsoftassert(IPL_SOFTNET);
+ NET_ASSERT_LOCKED();
if (tdbh == NULL)
return (struct tdb *) NULL;
@@ -507,7 +507,7 @@ tdb_walk(u_int rdomain, int (*walker)(struct tdb *, void *, int), void *arg)
int i, rval = 0;
struct tdb *tdbp, *next;
- splsoftassert(IPL_SOFTNET);
+ NET_ASSERT_LOCKED();
if (tdbh == NULL)
return ENOENT;
@@ -605,7 +605,7 @@ tdb_rehash(void)
u_int i, old_hashmask = tdb_hashmask;
u_int32_t hashval;
- splsoftassert(IPL_SOFTNET);
+ NET_ASSERT_LOCKED();
tdb_hashmask = (tdb_hashmask << 1) | 1;
@@ -664,7 +664,7 @@ puttdb(struct tdb *tdbp)
{
u_int32_t hashval;
- splsoftassert(IPL_SOFTNET);
+ NET_ASSERT_LOCKED();
if (tdbh == NULL) {
arc4random_buf(&tdbkey, sizeof(tdbkey));
@@ -718,7 +718,7 @@ tdb_delete(struct tdb *tdbp)
struct tdb *tdbpp;
u_int32_t hashval;
- splsoftassert(IPL_SOFTNET);
+ NET_ASSERT_LOCKED();
if (tdbh == NULL)
return;
diff --git a/sys/netinet/ip_mroute.c b/sys/netinet/ip_mroute.c
index 593a49a6bc8..e361758a65b 100644
--- a/sys/netinet/ip_mroute.c
+++ b/sys/netinet/ip_mroute.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_mroute.c,v 1.115 2017/05/16 08:32:17 rzalamena Exp $ */
+/* $OpenBSD: ip_mroute.c,v 1.116 2017/05/16 12:24:02 mpi Exp $ */
/* $NetBSD: ip_mroute.c,v 1.85 2004/04/26 01:31:57 matt Exp $ */
/*
@@ -535,7 +535,7 @@ ip_mrouter_done(struct socket *so)
struct ifnet *ifp;
unsigned int rtableid = inp->inp_rtableid;
- splsoftassert(IPL_SOFTNET);
+ NET_ASSERT_LOCKED();
/* Delete all remaining installed multicast routes. */
rtable_walk(rtableid, AF_INET, mrouter_rtwalk_delete, NULL);
@@ -659,7 +659,7 @@ add_vif(struct socket *so, struct mbuf *m)
int error;
unsigned int rtableid = inp->inp_rtableid;
- splsoftassert(IPL_SOFTNET);
+ NET_ASSERT_LOCKED();
if (m == NULL || m->m_len < sizeof(struct vifctl))
return (EINVAL);
@@ -722,7 +722,7 @@ del_vif(struct socket *so, struct mbuf *m)
vifi_t *vifip;
unsigned int rtableid = inp->inp_rtableid;
- splsoftassert(IPL_SOFTNET);
+ NET_ASSERT_LOCKED();
if (m == NULL || m->m_len < sizeof(vifi_t))
return (EINVAL);
@@ -964,7 +964,7 @@ add_mfc(struct socket *so, struct mbuf *m)
int mfcctl_size = sizeof(struct mfcctl);
unsigned int rtableid = inp->inp_rtableid;
- splsoftassert(IPL_SOFTNET);
+ NET_ASSERT_LOCKED();
if (mrt_api_config & MRT_API_FLAGS_ALL)
mfcctl_size = sizeof(struct mfcctl2);
@@ -1002,7 +1002,7 @@ del_mfc(struct socket *so, struct mbuf *m)
struct mfcctl *mp;
unsigned int rtableid = inp->inp_rtableid;
- splsoftassert(IPL_SOFTNET);
+ NET_ASSERT_LOCKED();
/*
* XXX: for deleting MFC entries the information in entries
diff --git a/sys/netinet/ipsec_input.c b/sys/netinet/ipsec_input.c
index 8b275147443..08efc2d4c60 100644
--- a/sys/netinet/ipsec_input.c
+++ b/sys/netinet/ipsec_input.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ipsec_input.c,v 1.151 2017/05/12 23:05:58 bluhm Exp $ */
+/* $OpenBSD: ipsec_input.c,v 1.152 2017/05/16 12:24:02 mpi Exp $ */
/*
* The authors of this code are John Ioannidis (ji@tla.org),
* Angelos D. Keromytis (kermit@csd.uch.gr) and
@@ -119,7 +119,7 @@ ipsec_common_input(struct mbuf *m, int skip, int protoff, int af, int sproto,
char buf[INET6_ADDRSTRLEN];
#endif
- splsoftassert(IPL_SOFTNET);
+ NET_ASSERT_LOCKED();
IPSEC_ISTAT(espstat.esps_input, ahstat.ahs_input,
ipcompstat.ipcomps_input);
@@ -799,7 +799,7 @@ udpencap_ctlinput(int cmd, struct sockaddr *sa, u_int rdomain, void *v)
struct sockaddr_in dst, src;
union sockaddr_union *su_dst, *su_src;
- splsoftassert(IPL_SOFTNET);
+ NET_ASSERT_LOCKED();
icp = (struct icmp *)((caddr_t) ip - offsetof(struct icmp, icmp_ip));
mtu = ntohs(icp->icmp_nextmtu);
diff --git a/sys/netinet/ipsec_output.c b/sys/netinet/ipsec_output.c
index 686f55c5ae4..61af386ed0c 100644
--- a/sys/netinet/ipsec_output.c
+++ b/sys/netinet/ipsec_output.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ipsec_output.c,v 1.66 2017/04/06 14:25:18 dhill Exp $ */
+/* $OpenBSD: ipsec_output.c,v 1.67 2017/05/16 12:24:02 mpi Exp $ */
/*
* The author of this code is Angelos D. Keromytis (angelos@cis.upenn.edu)
*
@@ -568,7 +568,7 @@ ipsec_adjust_mtu(struct mbuf *m, u_int32_t mtu)
struct m_tag *mtag;
ssize_t adjust;
- splsoftassert(IPL_SOFTNET);
+ NET_ASSERT_LOCKED();
for (mtag = m_tag_find(m, PACKET_TAG_IPSEC_OUT_DONE, NULL); mtag;
mtag = m_tag_find(m, PACKET_TAG_IPSEC_OUT_DONE, mtag)) {
diff --git a/sys/netinet/tcp_timer.c b/sys/netinet/tcp_timer.c
index 72854fa11bd..3d4bc5d0600 100644
--- a/sys/netinet/tcp_timer.c
+++ b/sys/netinet/tcp_timer.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tcp_timer.c,v 1.55 2017/04/19 15:21:54 bluhm Exp $ */
+/* $OpenBSD: tcp_timer.c,v 1.56 2017/05/16 12:24:02 mpi Exp $ */
/* $NetBSD: tcp_timer.c,v 1.14 1996/02/13 23:44:09 christos Exp $ */
/*
@@ -129,7 +129,7 @@ tcp_delack(void *arg)
void
tcp_slowtimo(void)
{
- splsoftassert(IPL_SOFTNET);
+ NET_ASSERT_LOCKED();
tcp_maxidle = TCPTV_KEEPCNT * tcp_keepintvl;
tcp_iss += TCP_ISSINCR2/PR_SLOWHZ; /* increment iss */
diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c
index 1ac6d1322f4..c3ab8a2e67b 100644
--- a/sys/netinet/tcp_usrreq.c
+++ b/sys/netinet/tcp_usrreq.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tcp_usrreq.c,v 1.149 2017/05/13 17:41:57 bluhm Exp $ */
+/* $OpenBSD: tcp_usrreq.c,v 1.150 2017/05/16 12:24:02 mpi Exp $ */
/* $NetBSD: tcp_usrreq.c,v 1.20 1996/02/13 23:44:16 christos Exp $ */
/*
@@ -734,7 +734,7 @@ tcp_ident(void *oldp, size_t *oldlenp, void *newp, size_t newlen, int dodrop)
struct in6_addr f6, l6;
#endif
- splsoftassert(IPL_SOFTNET);
+ NET_ASSERT_LOCKED();
if (dodrop) {
if (oldp != NULL || *oldlenp != 0)
diff --git a/sys/netinet6/frag6.c b/sys/netinet6/frag6.c
index baaec54bab1..a9a059cf32d 100644
--- a/sys/netinet6/frag6.c
+++ b/sys/netinet6/frag6.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: frag6.c,v 1.73 2017/04/14 20:46:31 bluhm Exp $ */
+/* $OpenBSD: frag6.c,v 1.74 2017/05/16 12:24:02 mpi Exp $ */
/* $KAME: frag6.c,v 1.40 2002/05/27 21:40:31 itojun Exp $ */
/*
@@ -603,7 +603,7 @@ frag6_slowtimo(void)
{
struct ip6q *q6, *nq6;
- splsoftassert(IPL_SOFTNET);
+ NET_ASSERT_LOCKED();
IP6Q_LOCK();
TAILQ_FOREACH_SAFE(q6, &frag6_queue, ip6q_queue, nq6)
diff --git a/sys/netinet6/in6.c b/sys/netinet6/in6.c
index d0fe43f2ad8..a378671a8bb 100644
--- a/sys/netinet6/in6.c
+++ b/sys/netinet6/in6.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: in6.c,v 1.204 2017/05/08 08:46:39 rzalamena Exp $ */
+/* $OpenBSD: in6.c,v 1.205 2017/05/16 12:24:02 mpi Exp $ */
/* $KAME: in6.c,v 1.372 2004/06/14 08:14:21 itojun Exp $ */
/*
@@ -500,7 +500,7 @@ in6_update_ifa(struct ifnet *ifp, struct in6_aliasreq *ifra,
struct rtentry *rt;
char addr[INET6_ADDRSTRLEN];
- splsoftassert(IPL_SOFTNET);
+ NET_ASSERT_LOCKED();
/* Validate parameters */
if (ifp == NULL || ifra == NULL) /* this maybe redundant */
@@ -900,7 +900,7 @@ in6_unlink_ifa(struct in6_ifaddr *ia6, struct ifnet *ifp)
extern int ifatrash;
int plen;
- splsoftassert(IPL_SOFTNET);
+ NET_ASSERT_LOCKED();
/* Release the reference to the base prefix. */
if (ia6->ia6_ndpr == NULL) {
@@ -1170,7 +1170,7 @@ in6_ifinit(struct ifnet *ifp, struct in6_ifaddr *ia6, int newhost)
int error = 0, plen, ifacount = 0;
struct ifaddr *ifa;
- splsoftassert(IPL_SOFTNET);
+ NET_ASSERT_LOCKED();
/*
* Give the interface a chance to initialize
@@ -1226,7 +1226,7 @@ in6_addmulti(struct in6_addr *maddr6, struct ifnet *ifp, int *errorp)
struct in6_ifreq ifr;
struct in6_multi *in6m;
- splsoftassert(IPL_SOFTNET);
+ NET_ASSERT_LOCKED();
*errorp = 0;
/*
@@ -1294,7 +1294,7 @@ in6_delmulti(struct in6_multi *in6m)
struct in6_ifreq ifr;
struct ifnet *ifp;
- splsoftassert(IPL_SOFTNET);
+ NET_ASSERT_LOCKED();
if (--in6m->in6m_refcnt == 0) {
/*
diff --git a/sys/netinet6/in6_ifattach.c b/sys/netinet6/in6_ifattach.c
index 8ebd35026f0..fad1eb130b6 100644
--- a/sys/netinet6/in6_ifattach.c
+++ b/sys/netinet6/in6_ifattach.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: in6_ifattach.c,v 1.101 2016/12/29 12:17:22 mpi Exp $ */
+/* $OpenBSD: in6_ifattach.c,v 1.102 2017/05/16 12:24:02 mpi Exp $ */
/* $KAME: in6_ifattach.c,v 1.124 2001/07/18 08:32:51 jinmei Exp $ */
/*
@@ -296,7 +296,7 @@ in6_ifattach_linklocal(struct ifnet *ifp, struct in6_addr *ifid)
struct in6_ifaddr *ia6;
int error, flags;
- splsoftassert(IPL_SOFTNET);
+ NET_ASSERT_LOCKED();
/*
* configure link-local address.
diff --git a/sys/netinet6/ip6_mroute.c b/sys/netinet6/ip6_mroute.c
index eb69664a634..20638b2fd1c 100644
--- a/sys/netinet6/ip6_mroute.c
+++ b/sys/netinet6/ip6_mroute.c
@@ -508,7 +508,7 @@ ip6_mrouter_done(struct socket *so)
struct ifnet *ifp;
unsigned int rtableid = inp->inp_rtableid;
- splsoftassert(IPL_SOFTNET);
+ NET_ASSERT_LOCKED();
/* Delete all remaining installed multicast routes. */
rtable_walk(rtableid, AF_INET6, mrouter6_rtwalk_delete, NULL);
@@ -561,7 +561,7 @@ add_m6if(struct socket *so, struct mif6ctl *mifcp)
int error;
unsigned int rtableid = inp->inp_rtableid;
- splsoftassert(IPL_SOFTNET);
+ NET_ASSERT_LOCKED();
if (mifcp->mif6c_mifi >= MAXMIFS)
return EINVAL;
@@ -618,7 +618,7 @@ del_m6if(struct socket *so, mifi_t *mifip)
struct inpcb *inp = sotoinpcb(so);
struct ifnet *ifp;
- splsoftassert(IPL_SOFTNET);
+ NET_ASSERT_LOCKED();
if (*mifip >= MAXMIFS)
return EINVAL;
@@ -802,7 +802,7 @@ add_m6fc(struct socket *so, struct mf6cctl *mfccp)
struct inpcb *inp = sotoinpcb(so);
unsigned int rtableid = inp->inp_rtableid;
- splsoftassert(IPL_SOFTNET);
+ NET_ASSERT_LOCKED();
return mf6c_add(mfccp, &mfccp->mf6cc_origin.sin6_addr,
&mfccp->mf6cc_mcastgrp.sin6_addr, mfccp->mf6cc_parent,
@@ -816,7 +816,7 @@ del_m6fc(struct socket *so, struct mf6cctl *mfccp)
struct rtentry *rt;
unsigned int rtableid = inp->inp_rtableid;
- splsoftassert(IPL_SOFTNET);
+ NET_ASSERT_LOCKED();
while ((rt = mf6c_find(NULL, &mfccp->mf6cc_origin.sin6_addr,
&mfccp->mf6cc_mcastgrp.sin6_addr, rtableid)) != NULL) {
@@ -860,7 +860,7 @@ ip6_mforward(struct ip6_hdr *ip6, struct ifnet *ifp, struct mbuf *m)
struct sockaddr_in6 sin6;
unsigned int rtableid = ifp->if_rdomain;
- splsoftassert(IPL_SOFTNET);
+ NET_ASSERT_LOCKED();
/*
* Don't forward a packet with Hop limit of zero or one,
@@ -1101,7 +1101,7 @@ phyint_send6(struct ifnet *ifp, struct ip6_hdr *ip6, struct mbuf *m)
struct sockaddr_in6 *dst6, sin6;
int error = 0;
- splsoftassert(IPL_SOFTNET);
+ NET_ASSERT_LOCKED();
/*
* Make a new reference to the packet; make sure that
diff --git a/sys/netinet6/mld6.c b/sys/netinet6/mld6.c
index 1c9e18399de..44e7cb17ce5 100644
--- a/sys/netinet6/mld6.c
+++ b/sys/netinet6/mld6.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mld6.c,v 1.53 2017/05/08 21:13:26 rzalamena Exp $ */
+/* $OpenBSD: mld6.c,v 1.54 2017/05/16 12:24:02 mpi Exp $ */
/* $KAME: mld6.c,v 1.26 2001/02/16 14:50:35 itojun Exp $ */
/*
@@ -345,7 +345,7 @@ mld6_checktimer(struct ifnet *ifp)
struct in6_multi *in6m;
struct ifmaddr *ifma;
- splsoftassert(IPL_SOFTNET);
+ NET_ASSERT_LOCKED();
TAILQ_FOREACH(ifma, &ifp->if_maddrlist, ifma_list) {
if (ifma->ifma_addr->sa_family != AF_INET6)
diff --git a/sys/netinet6/nd6.c b/sys/netinet6/nd6.c
index 8ee5a0c4797..7b32caec770 100644
--- a/sys/netinet6/nd6.c
+++ b/sys/netinet6/nd6.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nd6.c,v 1.208 2017/05/09 09:32:21 mpi Exp $ */
+/* $OpenBSD: nd6.c,v 1.209 2017/05/16 12:24:02 mpi Exp $ */
/* $KAME: nd6.c,v 1.280 2002/06/08 19:52:07 itojun Exp $ */
/*
@@ -513,7 +513,7 @@ nd6_purge(struct ifnet *ifp)
struct nd_defrouter *dr, *ndr;
struct nd_prefix *pr, *npr;
- splsoftassert(IPL_SOFTNET);
+ NET_ASSERT_LOCKED();
/*
* Nuke default router list entries toward ifp.
@@ -746,7 +746,7 @@ nd6_free(struct rtentry *rt, int gc)
struct nd_defrouter *dr;
struct ifnet *ifp;
- splsoftassert(IPL_SOFTNET);
+ NET_ASSERT_LOCKED();
ifp = if_get(rt->rt_ifidx);
@@ -1130,7 +1130,7 @@ nd6_ioctl(u_long cmd, caddr_t data, struct ifnet *ifp)
struct rtentry *rt;
int error = 0;
- splsoftassert(IPL_SOFTNET);
+ NET_ASSERT_LOCKED();
switch (cmd) {
case SIOCGIFINFO_IN6:
diff --git a/sys/netinet6/nd6_nbr.c b/sys/netinet6/nd6_nbr.c
index fef9d7e0a93..b44bc83de5d 100644
--- a/sys/netinet6/nd6_nbr.c
+++ b/sys/netinet6/nd6_nbr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nd6_nbr.c,v 1.115 2017/02/09 15:23:35 jca Exp $ */
+/* $OpenBSD: nd6_nbr.c,v 1.116 2017/05/16 12:24:04 mpi Exp $ */
/* $KAME: nd6_nbr.c,v 1.61 2001/02/10 16:06:14 jinmei Exp $ */
/*
@@ -571,7 +571,7 @@ nd6_na_input(struct mbuf *m, int off, int icmp6len)
union nd_opts ndopts;
char addr[INET6_ADDRSTRLEN], addr0[INET6_ADDRSTRLEN];
- splsoftassert(IPL_SOFTNET);
+ NET_ASSERT_LOCKED();
ifp = if_get(m->m_pkthdr.ph_ifidx);
if (ifp == NULL)
@@ -1099,7 +1099,7 @@ nd6_dad_start(struct ifaddr *ifa)
struct dadq *dp;
char addr[INET6_ADDRSTRLEN];
- splsoftassert(IPL_SOFTNET);
+ NET_ASSERT_LOCKED();
if (!dad_init) {
TAILQ_INIT(&dadq);
diff --git a/sys/netinet6/nd6_rtr.c b/sys/netinet6/nd6_rtr.c
index f340637b55f..7fc1e36e0ec 100644
--- a/sys/netinet6/nd6_rtr.c
+++ b/sys/netinet6/nd6_rtr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nd6_rtr.c,v 1.157 2017/03/06 08:56:39 mpi Exp $ */
+/* $OpenBSD: nd6_rtr.c,v 1.158 2017/05/16 12:24:04 mpi Exp $ */
/* $KAME: nd6_rtr.c,v 1.97 2001/02/07 11:09:13 itojun Exp $ */
/*
@@ -204,7 +204,7 @@ nd6_rs_output(struct ifnet* ifp, struct in6_ifaddr *ia6)
caddr_t mac;
int icmp6len, maxlen;
- splsoftassert(IPL_SOFTNET);
+ NET_ASSERT_LOCKED();
KASSERT(ia6 != NULL);
KASSERT(ifp->if_flags & IFF_RUNNING);
@@ -870,7 +870,7 @@ defrtrlist_update(struct nd_defrouter *new)
struct nd_defrouter *dr, *n;
struct in6_ifextra *ext = new->ifp->if_afdata[AF_INET6];
- splsoftassert(IPL_SOFTNET);
+ NET_ASSERT_LOCKED();
if ((dr = defrouter_lookup(&new->rtaddr, new->ifp->if_index)) != NULL) {
/* entry exists */
@@ -1014,7 +1014,7 @@ purge_detached(struct ifnet *ifp)
struct in6_ifaddr *ia6;
struct ifaddr *ifa, *ifa_next;
- splsoftassert(IPL_SOFTNET);
+ NET_ASSERT_LOCKED();
LIST_FOREACH_SAFE(pr, &nd_prefix, ndpr_entry, pr_next) {
/*
@@ -1050,7 +1050,7 @@ nd6_prelist_add(struct nd_prefix *pr, struct nd_defrouter *dr,
struct in6_ifextra *ext = pr->ndpr_ifp->if_afdata[AF_INET6];
int i;
- splsoftassert(IPL_SOFTNET);
+ NET_ASSERT_LOCKED();
if (ip6_maxifprefixes >= 0) {
if (ext->nprefixes >= ip6_maxifprefixes / 2) {
@@ -1110,7 +1110,7 @@ prelist_remove(struct nd_prefix *pr)
struct in6_ifextra *ext = pr->ndpr_ifp->if_afdata[AF_INET6];
int e;
- splsoftassert(IPL_SOFTNET);
+ NET_ASSERT_LOCKED();
/* make sure to invalidate the prefix until it is really freed. */
pr->ndpr_vltime = 0;
@@ -1165,7 +1165,7 @@ prelist_update(struct nd_prefix *new, struct nd_defrouter *dr, struct mbuf *m)
struct in6_addrlifetime lt6_tmp;
char addr[INET6_ADDRSTRLEN];
- splsoftassert(IPL_SOFTNET);
+ NET_ASSERT_LOCKED();
auth = 0;
if (m) {
@@ -1833,7 +1833,7 @@ in6_ifadd(struct nd_prefix *pr, int privacy)
struct in6_addr mask, rand_ifid;
int prefixlen = pr->ndpr_plen;
- splsoftassert(IPL_SOFTNET);
+ NET_ASSERT_LOCKED();
in6_prefixlen2mask(&mask, prefixlen);
@@ -2014,7 +2014,7 @@ in6_init_address_ltimes(struct nd_prefix *new, struct in6_addrlifetime *lt6)
void
rt6_flush(struct in6_addr *gateway, struct ifnet *ifp)
{
- splsoftassert(IPL_SOFTNET);
+ NET_ASSERT_LOCKED();
/* We'll care only link-local addresses */
if (!IN6_IS_ADDR_LINKLOCAL(gateway))