From 886be2b2bf09a8be00fb57a1aba46d42308ff89e Mon Sep 17 00:00:00 2001 From: Alexander Bluhm Date: Sun, 8 Jan 2017 02:16:09 +0000 Subject: When if_down() is called, sppp_keepalive() needs a NET_LOCK(). OK visa@ mpi@ --- sys/net/if_spppsubr.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'sys/net') 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); } -- cgit v1.2.3