From 228d9dcada84657afedded568e42449ef9d104f9 Mon Sep 17 00:00:00 2001 From: knakahara Date: Fri, 7 Dec 2018 09:11:04 +0000 Subject: ipsecif(4) should not increment drop counter by errors not related to if_snd. Pointed out by ozaki-r@n.o, thanks. --- sys/netipsec/ipsecif.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'sys') 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 -__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 */ -- cgit