Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/net It is silly to kill the system when an interface fai...
details: https://anonhg.NetBSD.org/src/rev/dfa8e3154c22
branches: trunk
changeset: 325096:dfa8e3154c22
user: christos <christos%NetBSD.org@localhost>
date: Thu Dec 05 15:55:35 2013 +0000
description:
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.
diffstat:
sys/net/bpf.c | 12 +++++++-----
1 files changed, 7 insertions(+), 5 deletions(-)
diffs (40 lines):
diff -r 011f73f32eed -r dfa8e3154c22 sys/net/bpf.c
--- a/sys/net/bpf.c Thu Dec 05 15:53:50 2013 +0000
+++ b/sys/net/bpf.c Thu Dec 05 15:55:35 2013 +0000
@@ -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 <sys/cdefs.h>
-__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 @@
* If so, turn it off.
*/
if (d->bd_promisc) {
- int error;
+ int error __diagused;
d->bd_promisc = 0;
/*
@@ -367,8 +367,10 @@
* 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;
Home |
Main Index |
Thread Index |
Old Index