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

crash.
This commit is contained in:
mlelstv 2017-02-18 18:08:16 +00:00
parent 03b4ea3bfc
commit c910290e61
1 changed files with 6 additions and 2 deletions

View File

@ -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 @@ npf_log(npf_cache_t *npc, void *meta, const npf_match_info_t *mi, int *decision)
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));