summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorknakahara <knakahara@NetBSD.org>2018-12-07 09:11:04 +0000
committerknakahara <knakahara@NetBSD.org>2018-12-07 09:11:04 +0000
commit228d9dcada84657afedded568e42449ef9d104f9 (patch)
tree03ffa5f5dbb591ae3eda352a8bdd70b190037e4c /sys
parenta56d9ad7d6937a691a39f9238d5a5fc337187e9c (diff)
ipsecif(4) should not increment drop counter by errors not related to if_snd. Pointed out by ozaki-r@n.o, thanks.
Diffstat (limited to 'sys')
-rw-r--r--sys/netipsec/ipsecif.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/sys/netipsec/ipsecif.c b/sys/netipsec/ipsecif.c
index fffef8e48ee..2f725abfdd5 100644
--- a/sys/netipsec/ipsecif.c
+++ b/sys/netipsec/ipsecif.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ipsecif.c,v 1.11 2018/11/15 10:23:56 maxv Exp $ */
+/* $NetBSD: ipsecif.c,v 1.12 2018/12/07 09:11:04 knakahara Exp $ */
/*
* Copyright (c) 2017 Internet Initiative Japan Inc.
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ipsecif.c,v 1.11 2018/11/15 10:23:56 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ipsecif.c,v 1.12 2018/12/07 09:11:04 knakahara Exp $");
#ifdef _KERNEL_OPT
#include "opt_inet.h"
@@ -364,10 +364,9 @@ ipsecif4_output(struct ipsec_variant *var, int family, struct mbuf *m)
KASSERT(sp->policy != IPSEC_POLICY_ENTRUST);
KASSERT(sp->policy != IPSEC_POLICY_BYPASS);
if (sp->policy != IPSEC_POLICY_IPSEC) {
- struct ifnet *ifp = &var->iv_softc->ipsec_if;
m_freem(m);
- IF_DROP(&ifp->if_snd);
- return 0;
+ error = ENETUNREACH;
+ goto done;
}
/* get flowinfo */