Module Name: src
Committed By: snj
Date: Mon Nov 6 09:59:01 UTC 2017
Modified Files:
src/sys/net [netbsd-8]: if_l2tp.c
Log Message:
Pull up following revision(s) (requested by knakahara in ticket #341):
sys/net/if_l2tp.c: revision 1.12
fix l2tp panic when l2tp session id is changed (same as if_vlan.c:r1.104)
E.g. the following operation causes this panic.
====================
# ifconfig l2tp0 create
# ifconfig l2tp0 session 140 140
# ifconfig l2tp1 create
# ifconfig l2tp1 session 200 200
# ifconfig l2tp1 session 300 300
panic: kernel diagnostic assertion "new->ple_next == NULL" failed: file
"/disk4/home/k-nakahara/repos/netbsd-src/sys/sys/pslist.h", line 118
====================
Pointed out by s-yamaguchi@IIJ, thanks.
To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.11.2.1 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.11 src/sys/net/if_l2tp.c:1.11.2.1
--- src/sys/net/if_l2tp.c:1.11 Thu Jun 1 02:45:14 2017
+++ src/sys/net/if_l2tp.c Mon Nov 6 09:59:01 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: if_l2tp.c,v 1.11 2017/06/01 02:45:14 chs Exp $ */
+/* $NetBSD: if_l2tp.c,v 1.11.2.1 2017/11/06 09:59:01 snj 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.11 2017/06/01 02:45:14 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_l2tp.c,v 1.11.2.1 2017/11/06 09:59:01 snj Exp $");
#ifdef _KERNEL_OPT
#include "opt_inet.h"
@@ -1069,6 +1069,7 @@ l2tp_set_session(struct l2tp_softc *sc,
pserialize_perform(l2tp_psz);
}
mutex_exit(&l2tp_hash.lock);
+ PSLIST_ENTRY_DESTROY(sc, l2tp_hash);
l2tp_variant_update(sc, nvar);
mutex_exit(&sc->l2tp_lock);
@@ -1078,6 +1079,7 @@ l2tp_set_session(struct l2tp_softc *sc,
log(LOG_DEBUG, "%s: add hash entry: sess_id=%" PRIu32 ", idx=%" PRIu32 "\n",
sc->l2tp_ec.ec_if.if_xname, nvar->lv_my_sess_id, idx);
+ PSLIST_ENTRY_INIT(sc, l2tp_hash);
mutex_enter(&l2tp_hash.lock);
PSLIST_WRITER_INSERT_HEAD(&l2tp_hash.lists[idx], sc, l2tp_hash);
mutex_exit(&l2tp_hash.lock);