From c16aecd18763fbd5add850e765868571437bf53a Mon Sep 17 00:00:00 2001 From: christos Date: Thu, 5 Dec 2013 15:55:35 +0000 Subject: [PATCH] It is silly to kill the system when an interface failed to clear promiscuous mode. Some return EINVAL when they are dying, but others like USB return EIO. Downgrade to a DIAGNOSTIC printf. Same should be done for the malloc/NOWAIT, but this is rarely hit. --- sys/net/bpf.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/sys/net/bpf.c b/sys/net/bpf.c index 604beb6d7a22..acf2f08a56e4 100644 --- a/sys/net/bpf.c +++ b/sys/net/bpf.c @@ -1,4 +1,4 @@ -/* $NetBSD: bpf.c,v 1.179 2013/11/16 01:13:52 rmind Exp $ */ +/* $NetBSD: bpf.c,v 1.180 2013/12/05 15:55:35 christos Exp $ */ /* * Copyright (c) 1990, 1991, 1993 @@ -39,7 +39,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: bpf.c,v 1.179 2013/11/16 01:13:52 rmind Exp $"); +__KERNEL_RCSID(0, "$NetBSD: bpf.c,v 1.180 2013/12/05 15:55:35 christos Exp $"); #if defined(_KERNEL_OPT) #include "opt_bpf.h" @@ -356,7 +356,7 @@ bpf_detachd(struct bpf_d *d) * If so, turn it off. */ if (d->bd_promisc) { - int error; + int error __diagused; d->bd_promisc = 0; /* @@ -367,8 +367,10 @@ bpf_detachd(struct bpf_d *d) * if we don't get an unexpected error. */ error = ifpromisc(bp->bif_ifp, 0); - if (error && error != EINVAL) - panic("%s: ifpromisc failed: %d", __func__, error); +#ifdef DIAGNOSTIC + if (error) + printf("%s: ifpromisc failed: %d", __func__, error); +#endif } /* Remove d from the interface's descriptor list. */ p = &bp->bif_dlist;