Module Name:    src
Committed By:   roy
Date:           Sun Oct 25 08:15:54 UTC 2020

Modified Files:
        src/sys/net: if_l2tp.c

Log Message:
l2tp: Revert prior

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


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/sys/net/if_l2tp.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/net/if_l2tp.c
diff -u src/sys/net/if_l2tp.c:1.44 src/sys/net/if_l2tp.c:1.45
--- src/sys/net/if_l2tp.c:1.44	Thu Oct 15 02:54:10 2020
+++ src/sys/net/if_l2tp.c	Sun Oct 25 08:15:54 2020
@@ -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 @@ l2tpattach0(struct l2tp_softc *sc)
 	 * 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 @@ l2tp_ioctl(struct ifnet *ifp, u_long cmd
 
 	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 @@ l2tp_set_tunnel(struct ifnet *ifp, struc
 	if (odst)
 		sockaddr_free(odst);
 	kmem_free(ovar, sizeof(*ovar));
-
-	if_link_state_change(ifp, LINK_STATE_UP);
 	return 0;
 
 error:

Reply via email to