summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFederico G. Schwindt <fgsch@cvs.openbsd.org>2001-06-29 22:46:06 +0000
committerFederico G. Schwindt <fgsch@cvs.openbsd.org>2001-06-29 22:46:06 +0000
commit3c67a2f1d6ce35ce613343e1efde0353ff8509fd (patch)
tree7fa437072d26c7c7907fe73101322223dce27721
parent1a2ba1622b54f4d4edc154fe9a40e39e49ca4f19 (diff)
Move ifq_maxlen setting to if_attach(). Doing it at if_init() is wrong,
and has been wrong since PnP devices (pcmcia, carbus, etc) shown up. If you forgot to set ifq_maxlen somewhere in the driver, you're gonna see baaaad things; jason@ ok, angelos@ "should be ok" , theo "don't understand why".
-rw-r--r--sys/net/if.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/sys/net/if.c b/sys/net/if.c
index 4dacd829228..9278b1bba7c 100644
--- a/sys/net/if.c
+++ b/sys/net/if.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if.c,v 1.48 2001/06/27 05:50:06 kjc Exp $ */
+/* $OpenBSD: if.c,v 1.49 2001/06/29 22:46:05 fgsch Exp $ */
/* $NetBSD: if.c,v 1.35 1996/05/07 05:26:04 thorpej Exp $ */
/*
@@ -135,13 +135,8 @@ extern void nd6_setmtu __P((struct ifnet *));
void
ifinit()
{
- struct ifnet *ifp;
static struct timeout if_slowtim;
- for (ifp = ifnet.tqh_first; ifp != 0; ifp = ifp->if_list.tqe_next)
- if (ifp->if_snd.ifq_maxlen == 0)
- ifp->if_snd.ifq_maxlen = ifqmaxlen;
-
timeout_set(&if_slowtim, if_slowtimo, &if_slowtim);
if_slowtimo(&if_slowtim);
@@ -203,6 +198,9 @@ if_attachsetup(ifp)
ifindex2ifnet[if_index] = ifp;
+ if (ifp->if_snd.ifq_maxlen == 0)
+ ifp->if_snd.ifq_maxlen = ifqmaxlen;
+
/*
* create a Link Level name for this device
*/