Source-Changes-HG archive

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

[src/trunk]: src/sys/net/npf npf_ifmap_getname requires the config to be lock...



details:   https://anonhg.NetBSD.org/src/rev/1324676180d9
branches:  trunk
changeset: 821834:1324676180d9
user:      mlelstv <mlelstv%NetBSD.org@localhost>
date:      Sat Feb 18 18:08:16 2017 +0000

description:
npf_ifmap_getname requires the config to be locked. For now, just prevent the
crash.

diffstat:

 sys/net/npf/npf_ext_log.c |  8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diffs (32 lines):

diff -r 3f6bcf4a1fc4 -r 1324676180d9 sys/net/npf/npf_ext_log.c
--- a/sys/net/npf/npf_ext_log.c Sat Feb 18 16:48:38 2017 +0000
+++ b/sys/net/npf/npf_ext_log.c Sat Feb 18 18:08:16 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: npf_ext_log.c,v 1.11 2017/01/29 00:15:54 christos Exp $        */
+/*     $NetBSD: npf_ext_log.c,v 1.12 2017/02/18 18:08:16 mlelstv Exp $ */
 
 /*-
  * Copyright (c) 2010-2012 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
 
 #ifdef _KERNEL
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: npf_ext_log.c,v 1.11 2017/01/29 00:15:54 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: npf_ext_log.c,v 1.12 2017/02/18 18:08:16 mlelstv Exp $");
 
 #include <sys/types.h>
 #include <sys/module.h>
@@ -104,9 +104,13 @@
        hdr.action = *decision == NPF_DECISION_PASS ?
            0 /* pass */ : 1 /* block */;
        hdr.reason = 0; /* match */
+#if 0
        struct nbuf *nb = npc->npc_nbuf;
        const char *ifname = nb && nb->nb_ifid ? 
            npf_ifmap_getname(npc->npc_ctx, nb->nb_ifid) : "???";
+#else
+       const char *ifname = "???";
+#endif
 
        strlcpy(hdr.ifname, ifname, sizeof(hdr.ifname));
 



Home | Main Index | Thread Index | Old Index