Source-Changes-HG archive

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

[src/trunk]: src/sys/net if_register() must be called after ifp->if_dl initia...



details:   https://anonhg.NetBSD.org/src/rev/0abccae5be6e
branches:  trunk
changeset: 348965:0abccae5be6e
user:      knakahara <knakahara%NetBSD.org@localhost>
date:      Fri Nov 18 08:13:02 2016 +0000

description:
if_register() must be called after ifp->if_dl initialized.

There may be similar problems. I will fix step by step...

diffstat:

 sys/net/if_pppoe.c |  8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diffs (30 lines):

diff -r c0b6b336e500 -r 0abccae5be6e sys/net/if_pppoe.c
--- a/sys/net/if_pppoe.c        Fri Nov 18 07:49:10 2016 +0000
+++ b/sys/net/if_pppoe.c        Fri Nov 18 08:13:02 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_pppoe.c,v 1.118 2016/10/03 11:06:06 ozaki-r Exp $ */
+/* $NetBSD: if_pppoe.c,v 1.119 2016/11/18 08:13:02 knakahara Exp $ */
 
 /*-
  * Copyright (c) 2002, 2008 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_pppoe.c,v 1.118 2016/10/03 11:06:06 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_pppoe.c,v 1.119 2016/11/18 08:13:02 knakahara Exp $");
 
 #ifdef _KERNEL_OPT
 #include "pppoe.h"
@@ -284,8 +284,10 @@
        sc->sc_sppp.pp_tlf = pppoe_tlf;
        sc->sc_sppp.pp_framebytes = PPPOE_HEADERLEN;    /* framing added to ppp packets */
 
-       if_attach(&sc->sc_sppp.pp_if);
+       if_initialize(&sc->sc_sppp.pp_if);
+       sc->sc_sppp.pp_if.if_percpuq = if_percpuq_create(&sc->sc_sppp.pp_if);
        sppp_attach(&sc->sc_sppp.pp_if);
+       if_register(&sc->sc_sppp.pp_if);
 
        bpf_attach(&sc->sc_sppp.pp_if, DLT_PPP_ETHER, 0);
        if (LIST_EMPTY(&pppoe_softc_list)) {



Home | Main Index | Thread Index | Old Index