From 160af078f36749781a41b41ab84f248d2cba5003 Mon Sep 17 00:00:00 2001 From: Sepherosa Ziehau Date: Mon, 23 Jun 2008 14:24:48 +0000 Subject: [PATCH] Discard packets which was lingering on msgport when receiving interface was brought down or entered monitor mode. --- sys/net/if_ethersubr.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c index ccc285f8fc..501b547208 100644 --- a/sys/net/if_ethersubr.c +++ b/sys/net/if_ethersubr.c @@ -32,7 +32,7 @@ * * @(#)if_ethersubr.c 8.1 (Berkeley) 6/10/93 * $FreeBSD: src/sys/net/if_ethersubr.c,v 1.70.2.33 2003/04/28 15:45:53 archie Exp $ - * $DragonFly: src/sys/net/if_ethersubr.c,v 1.68 2008/06/23 11:57:19 sephe Exp $ + * $DragonFly: src/sys/net/if_ethersubr.c,v 1.69 2008/06/23 14:24:48 sephe Exp $ */ #include "opt_atalk.h" @@ -1532,6 +1532,15 @@ dropanyway: static void ether_input_oncpu(struct ifnet *ifp, struct mbuf *m) { + if ((ifp->if_flags & (IFF_UP | IFF_MONITOR)) != IFF_UP) { + /* + * Receiving interface's flags are changed, when this + * packet is waiting for processing; discard it. + */ + m_freem(m); + return; + } + /* * Tap the packet off here for a bridge. bridge_input() * will return NULL if it has consumed the packet, otherwise -- 2.11.4.GIT