Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/net Insert an entry after initialization



details:   https://anonhg.NetBSD.org/src/rev/55f573826d43
branches:  trunk
changeset: 978574:55f573826d43
user:      yamaguchi <yamaguchi%NetBSD.org@localhost>
date:      Wed Nov 25 09:41:20 2020 +0000

description:
Insert an entry after initialization

diffstat:

 sys/net/if_spppsubr.c |  14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

diffs (42 lines):

diff -r a71177f8dbb7 -r 55f573826d43 sys/net/if_spppsubr.c
--- a/sys/net/if_spppsubr.c     Wed Nov 25 09:38:39 2020 +0000
+++ b/sys/net/if_spppsubr.c     Wed Nov 25 09:41:20 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_spppsubr.c,v 1.199 2020/11/25 09:38:39 yamaguchi Exp $       */
+/*     $NetBSD: if_spppsubr.c,v 1.200 2020/11/25 09:41:20 yamaguchi Exp $       */
 
 /*
  * Synchronous PPP/Cisco link level subroutines.
@@ -41,7 +41,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_spppsubr.c,v 1.199 2020/11/25 09:38:39 yamaguchi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_spppsubr.c,v 1.200 2020/11/25 09:41:20 yamaguchi Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_inet.h"
@@ -998,10 +998,6 @@
        if (! spppq_lock)
                spppq_lock = mutex_obj_alloc(MUTEX_DEFAULT, IPL_SOFTNET);
 
-       /* Insert new entry into the keepalive list. */
-       sp->pp_next = spppq;
-       spppq = sp;
-
        sp->pp_if.if_type = IFT_PPP;
        sp->pp_if.if_output = sppp_output;
        sp->pp_fastq.ifq_maxlen = 32;
@@ -1039,6 +1035,12 @@
        sppp_pap_init(sp);
        sppp_chap_init(sp);
        SPPP_UNLOCK(sp);
+
+       SPPPQ_LOCK();
+       /* Insert new entry into the keepalive list. */
+       sp->pp_next = spppq;
+       spppq = sp;
+       SPPPQ_UNLOCK();
 }
 
 void



Home | Main Index | Thread Index | Old Index