Source-Changes-HG archive

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

[src/trunk]: src/sys/net l2tp: Revert prior



details:   https://anonhg.NetBSD.org/src/rev/6c16ac35c277
branches:  trunk
changeset: 1015511:6c16ac35c277
user:      roy <roy%NetBSD.org@localhost>
date:      Sun Oct 25 08:15:54 2020 +0000

description:
l2tp: Revert prior

It proves I can't read comments and that if_initialize should not be used.

diffstat:

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

diffs (50 lines):

diff -r 02f580b17e0c -r 6c16ac35c277 sys/net/if_l2tp.c
--- a/sys/net/if_l2tp.c Sun Oct 25 08:10:03 2020 +0000
+++ b/sys/net/if_l2tp.c Sun Oct 25 08:15:54 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_l2tp.c,v 1.44 2020/10/15 02:54:10 roy Exp $ */
+/*     $NetBSD: if_l2tp.c,v 1.45 2020/10/25 08:15:54 roy Exp $ */
 
 /*
  * Copyright (c) 2017 Internet Initiative Japan Inc.
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_l2tp.c,v 1.44 2020/10/15 02:54:10 roy Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_l2tp.c,v 1.45 2020/10/25 08:15:54 roy Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -321,13 +321,11 @@
         * if_percpuq_enqueue(). However, that causes recursive softnet_lock
         * when NET_MPSAFE is not set.
         */
-       rv = if_initialize(&sc->l2tp_ec.ec_if);
+       rv = if_attach(&sc->l2tp_ec.ec_if);
        if (rv != 0)
                return rv;
-       sc->l2tp_ec.ec_if.if_link_state = LINK_STATE_DOWN;
        if_alloc_sadl(&sc->l2tp_ec.ec_if);
        bpf_attach(&sc->l2tp_ec.ec_if, DLT_EN10MB, sizeof(struct ether_header));
-       if_register(&sc->l2tp_ec.ec_if);
 
        return 0;
 }
@@ -811,7 +809,6 @@
 
        case SIOCDIFPHYADDR:
                l2tp_delete_tunnel(&sc->l2tp_ec.ec_if);
-               if_link_state_change(&sc->l2tp_ec.ec_if, LINK_STATE_DOWN);
                break;
 
        case SIOCGIFPSRCADDR:
@@ -1074,8 +1071,6 @@
        if (odst)
                sockaddr_free(odst);
        kmem_free(ovar, sizeof(*ovar));
-
-       if_link_state_change(ifp, LINK_STATE_UP);
        return 0;
 
 error:



Home | Main Index | Thread Index | Old Index