If the parent interface is not IFF_RUNNING, do not call its start function.

This prevent a variety of fun panics, and therefore fixes PR 12932, PR 17561,
and PR 18376...

XXX
...however this is most definitely a hack.  The real problem here is that there
is no callback to notify a "client" interface like vlan when a "parent"
interface's status changes, and therefore the vlan interface is always
IFF_RUNNING.  This allows packets to be queued on vlan interface at any time.
We can't simply leave the packets on the vlan interface, either, because there
is no callback to dequeue them.  And last, since it's always IFF_RUNNING, if
we just *toss* the packets, we lose gratuitous ARPs and DAD packets.

"This needs work," but at least it no longer bleeds.
This commit is contained in:
mycroft 2004-07-08 19:09:12 +00:00
parent a127f24934
commit 7cd90d66b7

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_vlan.c,v 1.40 2004/04/23 02:58:29 simonb Exp $ */
/* $NetBSD: if_vlan.c,v 1.41 2004/07/08 19:09:12 mycroft Exp $ */
/*-
* Copyright (c) 2000, 2001 The NetBSD Foundation, Inc.
@ -85,7 +85,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_vlan.c,v 1.40 2004/04/23 02:58:29 simonb Exp $");
__KERNEL_RCSID(0, "$NetBSD: if_vlan.c,v 1.41 2004/07/08 19:09:12 mycroft Exp $");
#include "opt_inet.h"
#include "bpfilter.h"
@ -824,7 +824,7 @@ vlan_start(struct ifnet *ifp)
}
ifp->if_opackets++;
if ((p->if_flags & IFF_OACTIVE) == 0)
if ((p->if_flags & (IFF_RUNNING|IFF_OACTIVE)) == IFF_RUNNING)
(*p->if_start)(p);
}