Source-Changes-HG archive

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

[src/netbsd-8]: src/sys/net Pull up following revision(s) (requested by knaka...



details:   https://anonhg.NetBSD.org/src/rev/d93a51645f1c
branches:  netbsd-8
changeset: 445287:d93a51645f1c
user:      martin <martin%NetBSD.org@localhost>
date:      Sun Oct 21 11:55:54 2018 +0000

description:
Pull up following revision(s) (requested by knakahara in ticket #1066):

        sys/net/if_vlan.c: revision 1.133
        sys/net/if_gif.h: revision 1.32
        sys/net/if_ipsec.c: revision 1.18
        sys/net/if_ipsec.h: revision 1.4
        sys/net/if_gif.c: revision 1.144
        sys/net/if_l2tp.h: revision 1.6
        sys/net/if_l2tp.c: revision 1.30

Fix panic when doing ioctl to multiple pseudo interfaces. Pointed out by k-goda@IIJ.

XXX pullup-8

diffstat:

 sys/net/if_gif.c   |  13 ++++++-------
 sys/net/if_gif.h   |   4 +++-
 sys/net/if_ipsec.c |  12 ++++++------
 sys/net/if_ipsec.h |   4 +++-
 sys/net/if_l2tp.c  |   8 +++++---
 sys/net/if_l2tp.h  |   4 +++-
 sys/net/if_vlan.c  |   5 +++--
 7 files changed, 29 insertions(+), 21 deletions(-)

diffs (283 lines):

diff -r 0086e4b4cdbb -r d93a51645f1c sys/net/if_gif.c
--- a/sys/net/if_gif.c  Wed Oct 17 13:51:53 2018 +0000
+++ b/sys/net/if_gif.c  Sun Oct 21 11:55:54 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_gif.c,v 1.126.2.11 2018/06/07 17:42:25 martin Exp $ */
+/*     $NetBSD: if_gif.c,v 1.126.2.12 2018/10/21 11:55:54 martin Exp $ */
 /*     $KAME: if_gif.c,v 1.76 2001/08/20 02:01:02 kjc Exp $    */
 
 /*
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_gif.c,v 1.126.2.11 2018/06/07 17:42:25 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_gif.c,v 1.126.2.12 2018/10/21 11:55:54 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -105,7 +105,6 @@
        kmutex_t lock;
 } gif_softcs __cacheline_aligned;
 
-pserialize_t gif_psz __read_mostly;
 struct psref_class *gv_psref_class __read_mostly;
 
 static void    gif_ro_init_pc(void *, void *, struct cpu_info *);
@@ -224,7 +223,6 @@
        LIST_INIT(&gif_softcs.list);
        if_clone_attach(&gif_cloner);
 
-       gif_psz = pserialize_create();
        gv_psref_class = psref_class_create("gifvar", IPL_SOFTNET);
 
        gif_sysctl_setup();
@@ -243,7 +241,6 @@
 
        if (error == 0) {
                psref_class_destroy(gv_psref_class);
-               pserialize_destroy(gif_psz);
 
                if_clone_detach(&gif_cloner);
                sysctl_teardown(&gif_sysctl);
@@ -275,9 +272,10 @@
 
        sc->gif_var = var;
        mutex_init(&sc->gif_lock, MUTEX_DEFAULT, IPL_NONE);
+       sc->gif_psz = pserialize_create();
+
        sc->gif_ro_percpu = percpu_alloc(sizeof(struct gif_ro));
        percpu_foreach(sc->gif_ro_percpu, gif_ro_init_pc, NULL);
-
        mutex_enter(&gif_softcs.lock);
        LIST_INSERT_HEAD(&gif_softcs.list, sc, gif_list);
        mutex_exit(&gif_softcs.lock);
@@ -355,6 +353,7 @@
        percpu_foreach(sc->gif_ro_percpu, gif_ro_fini_pc, NULL);
        percpu_free(sc->gif_ro_percpu, sizeof(struct gif_ro));
 
+       pserialize_destroy(sc->gif_psz);
        mutex_destroy(&sc->gif_lock);
 
        var = sc->gif_var;
@@ -1173,7 +1172,7 @@
        KASSERT(mutex_owned(&sc->gif_lock));
 
        sc->gif_var = nvar;
-       pserialize_perform(gif_psz);
+       pserialize_perform(sc->gif_psz);
        psref_target_destroy(&ovar->gv_psref, gv_psref_class);
 
        if (nvar->gv_psrc != NULL && nvar->gv_pdst != NULL)
diff -r 0086e4b4cdbb -r d93a51645f1c sys/net/if_gif.h
--- a/sys/net/if_gif.h  Wed Oct 17 13:51:53 2018 +0000
+++ b/sys/net/if_gif.h  Sun Oct 21 11:55:54 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_gif.h,v 1.25.8.3 2018/05/17 14:07:03 martin Exp $   */
+/*     $NetBSD: if_gif.h,v 1.25.8.4 2018/10/21 11:55:54 martin Exp $   */
 /*     $KAME: if_gif.h,v 1.23 2001/07/27 09:21:42 itojun Exp $ */
 
 /*
@@ -40,6 +40,7 @@
 #include <sys/queue.h>
 #include <sys/percpu.h>
 #ifdef _KERNEL
+#include <sys/pserialize.h>
 #include <sys/psref.h>
 #endif
 
@@ -78,6 +79,7 @@
                                         * instead of direct dereference.
                                         */
        kmutex_t gif_lock;              /* writer lock for gif_var */
+       pserialize_t gif_psz;
 
        LIST_ENTRY(gif_softc) gif_list; /* list of all gifs */
 };
diff -r 0086e4b4cdbb -r d93a51645f1c sys/net/if_ipsec.c
--- a/sys/net/if_ipsec.c        Wed Oct 17 13:51:53 2018 +0000
+++ b/sys/net/if_ipsec.c        Sun Oct 21 11:55:54 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_ipsec.c,v 1.3.2.9 2018/06/07 16:22:43 martin Exp $  */
+/*     $NetBSD: if_ipsec.c,v 1.3.2.10 2018/10/21 11:55:54 martin Exp $  */
 
 /*
  * Copyright (c) 2017 Internet Initiative Japan Inc.
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_ipsec.c,v 1.3.2.9 2018/06/07 16:22:43 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ipsec.c,v 1.3.2.10 2018/10/21 11:55:54 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -145,7 +145,6 @@
        kmutex_t lock;
 } ipsec_softcs __cacheline_aligned;
 
-pserialize_t ipsec_psz __read_mostly;
 struct psref_class *iv_psref_class __read_mostly;
 
 struct if_clone ipsec_cloner =
@@ -160,7 +159,6 @@
        mutex_init(&ipsec_softcs.lock, MUTEX_DEFAULT, IPL_NONE);
        LIST_INIT(&ipsec_softcs.list);
 
-       ipsec_psz = pserialize_create();
        iv_psref_class = psref_class_create("ipsecvar", IPL_SOFTNET);
 
        if_clone_attach(&ipsec_cloner);
@@ -184,6 +182,7 @@
 
        sc->ipsec_var = var;
        mutex_init(&sc->ipsec_lock, MUTEX_DEFAULT, IPL_NONE);
+       sc->ipsec_psz = pserialize_create();
        sc->ipsec_ro_percpu = percpu_alloc(sizeof(struct ipsec_ro));
        percpu_foreach(sc->ipsec_ro_percpu, if_ipsec_ro_init_pc, NULL);
 
@@ -254,6 +253,7 @@
        percpu_foreach(sc->ipsec_ro_percpu, if_ipsec_ro_fini_pc, NULL);
        percpu_free(sc->ipsec_ro_percpu, sizeof(struct ipsec_ro));
 
+       pserialize_destroy(sc->ipsec_psz);
        mutex_destroy(&sc->ipsec_lock);
 
        var = sc->ipsec_var;
@@ -1785,7 +1785,7 @@
         * "null" config variant to sc->ipsec_var.
         */
        sc->ipsec_var = nullvar;
-       pserialize_perform(ipsec_psz);
+       pserialize_perform(sc->ipsec_psz);
        psref_target_destroy(&ovar->iv_psref, iv_psref_class);
 
        error = if_ipsec_replace_sp(sc, ovar, nvar);
@@ -1796,7 +1796,7 @@
                psref_target_init(&ovar->iv_psref, iv_psref_class);
        }
 
-       pserialize_perform(ipsec_psz);
+       pserialize_perform(sc->ipsec_psz);
        psref_target_destroy(&nullvar->iv_psref, iv_psref_class);
 
        if (if_ipsec_variant_is_configured(sc->ipsec_var))
diff -r 0086e4b4cdbb -r d93a51645f1c sys/net/if_ipsec.h
--- a/sys/net/if_ipsec.h        Wed Oct 17 13:51:53 2018 +0000
+++ b/sys/net/if_ipsec.h        Sun Oct 21 11:55:54 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_ipsec.h,v 1.1.2.3 2018/05/17 14:07:03 martin Exp $  */
+/*     $NetBSD: if_ipsec.h,v 1.1.2.4 2018/10/21 11:55:54 martin Exp $  */
 
 /*
  * Copyright (c) 2017 Internet Initiative Japan Inc.
@@ -35,6 +35,7 @@
 
 #include <sys/queue.h>
 #ifdef _KERNEL
+#include <sys/pserialize.h>
 #include <sys/psref.h>
 #endif
 
@@ -98,6 +99,7 @@
                                          * instead of direct dereference.
                                          */
        kmutex_t ipsec_lock;            /* writer lock for ipsec_var */
+       pserialize_t ipsec_psz;
 
        LIST_ENTRY(ipsec_softc) ipsec_list; /* list of all gifs */
 };
diff -r 0086e4b4cdbb -r d93a51645f1c sys/net/if_l2tp.c
--- a/sys/net/if_l2tp.c Wed Oct 17 13:51:53 2018 +0000
+++ b/sys/net/if_l2tp.c Sun Oct 21 11:55:54 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_l2tp.c,v 1.11.2.9 2018/07/26 23:55:31 snj Exp $     */
+/*     $NetBSD: if_l2tp.c,v 1.11.2.10 2018/10/21 11:55:54 martin 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.2.9 2018/07/26 23:55:31 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_l2tp.c,v 1.11.2.10 2018/10/21 11:55:54 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -245,6 +245,7 @@
 
        sc->l2tp_var = var;
        mutex_init(&sc->l2tp_lock, MUTEX_DEFAULT, IPL_NONE);
+       sc->l2tp_psz = pserialize_create();
        PSLIST_ENTRY_INIT(sc, l2tp_hash);
 
        sc->l2tp_ro_percpu = percpu_alloc(sizeof(struct l2tp_ro));
@@ -339,6 +340,7 @@
        percpu_free(sc->l2tp_ro_percpu, sizeof(struct l2tp_ro));
 
        kmem_free(var, sizeof(struct l2tp_variant));
+       pserialize_destroy(sc->l2tp_psz);
        mutex_destroy(&sc->l2tp_lock);
        kmem_free(sc, sizeof(struct l2tp_softc));
 
@@ -1202,7 +1204,7 @@
        KASSERT(mutex_owned(&sc->l2tp_lock));
 
        sc->l2tp_var = nvar;
-       pserialize_perform(l2tp_psz);
+       pserialize_perform(sc->l2tp_psz);
        psref_target_destroy(&ovar->lv_psref, lv_psref_class);
 
        /*
diff -r 0086e4b4cdbb -r d93a51645f1c sys/net/if_l2tp.h
--- a/sys/net/if_l2tp.h Wed Oct 17 13:51:53 2018 +0000
+++ b/sys/net/if_l2tp.h Sun Oct 21 11:55:54 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_l2tp.h,v 1.2.2.2 2018/05/17 14:07:03 martin Exp $   */
+/*     $NetBSD: if_l2tp.h,v 1.2.2.3 2018/10/21 11:55:54 martin Exp $   */
 
 /*
  * Copyright (c) 2017 Internet Initiative Japan Inc.
@@ -36,6 +36,7 @@
 #include <sys/queue.h>
 #include <sys/ioccom.h>
 #ifdef _KERNEL
+#include <sys/pserialize.h>
 #include <sys/psref.h>
 #include <sys/pslist.h>
 #endif
@@ -104,6 +105,7 @@
                                        * instead of direct dereference.
                                        */
        kmutex_t l2tp_lock;             /* writer lock for l2tp_var */
+       pserialize_t l2tp_psz;
 
        LIST_ENTRY(l2tp_softc) l2tp_list; /* list of all l2tps */
        struct pslist_entry l2tp_hash;  /* hashed list to lookup by session id */
diff -r 0086e4b4cdbb -r d93a51645f1c sys/net/if_vlan.c
--- a/sys/net/if_vlan.c Wed Oct 17 13:51:53 2018 +0000
+++ b/sys/net/if_vlan.c Sun Oct 21 11:55:54 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_vlan.c,v 1.97.2.14 2018/06/12 16:34:04 snj Exp $    */
+/*     $NetBSD: if_vlan.c,v 1.97.2.15 2018/10/21 11:55:54 martin Exp $ */
 
 /*-
  * Copyright (c) 2000, 2001 The NetBSD Foundation, Inc.
@@ -78,7 +78,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_vlan.c,v 1.97.2.14 2018/06/12 16:34:04 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_vlan.c,v 1.97.2.15 2018/10/21 11:55:54 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -408,6 +408,7 @@
 
        psref_target_destroy(&ifv->ifv_mib->ifvm_psref, ifvm_psref_class);
        kmem_free(ifv->ifv_mib, sizeof(struct ifvlan_linkmib));
+       pserialize_destroy(ifv->ifv_psz);
        mutex_destroy(&ifv->ifv_lock);
        free(ifv, M_DEVBUF);
 



Home | Main Index | Thread Index | Old Index