summaryrefslogtreecommitdiff
path: root/sys/net
diff options
context:
space:
mode:
authorAlexander Bluhm <bluhm@cvs.openbsd.org>2017-01-08 02:16:09 +0000
committerAlexander Bluhm <bluhm@cvs.openbsd.org>2017-01-08 02:16:09 +0000
commit886be2b2bf09a8be00fb57a1aba46d42308ff89e (patch)
treeeeb5907ecbb5f5c4d6eaf94959558196d0f5ae43 /sys/net
parentb28a1c03a84d6f07b8f952481d3bfec9443cbb96 (diff)
When if_down() is called, sppp_keepalive() needs a NET_LOCK().
OK visa@ mpi@
Diffstat (limited to 'sys/net')
-rw-r--r--sys/net/if_spppsubr.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/net/if_spppsubr.c b/sys/net/if_spppsubr.c
index aa4d79576ca..562f5530a89 100644
--- a/sys/net/if_spppsubr.c
+++ b/sys/net/if_spppsubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_spppsubr.c,v 1.158 2017/01/02 08:41:21 mpi Exp $ */
+/* $OpenBSD: if_spppsubr.c,v 1.159 2017/01/08 02:16:08 bluhm Exp $ */
/*
* Synchronous PPP link level subroutines.
*
@@ -693,7 +693,7 @@ sppp_attach(struct ifnet *ifp)
/* Initialize keepalive handler. */
if (! spppq) {
- timeout_set(&keepalive_ch, sppp_keepalive, NULL);
+ timeout_set_proc(&keepalive_ch, sppp_keepalive, NULL);
timeout_add_sec(&keepalive_ch, 10);
}
@@ -4050,9 +4050,10 @@ void
sppp_keepalive(void *dummy)
{
struct sppp *sp;
- int s;
+ int s, sl;
struct timeval tv;
+ NET_LOCK(sl);
s = splnet();
getmicrouptime(&tv);
for (sp=spppq; sp; sp=sp->pp_next) {
@@ -4104,6 +4105,7 @@ sppp_keepalive(void *dummy)
}
}
splx(s);
+ NET_UNLOCK(sl);
timeout_add_sec(&keepalive_ch, 10);
}