From e29be9ada8c29f05c864d7820481379f0a86ddff Mon Sep 17 00:00:00 2001 From: peter Date: Mon, 26 Apr 1999 09:02:40 +0000 Subject: Protect the ifinit() function's internals with splimp() for safety since it used to be that way. I'm not sure that it's needed, but it does walk the ifp list.. Incidently, there's nothing to sanity check the ifq_maxlen on loaded interfaces.. --- sys/net/if.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'sys/net/if.c') diff --git a/sys/net/if.c b/sys/net/if.c index 635be7d..62a62af 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)if.c 8.3 (Berkeley) 1/4/94 - * $Id: if.c,v 1.66 1999/02/19 13:41:35 phk Exp $ + * $Id: if.c,v 1.67 1999/04/16 21:22:44 peter Exp $ */ #include "opt_compat.h" @@ -76,22 +76,23 @@ struct ifnethead ifnet; /* depend on static init XXX */ * * Routines with ifa_ifwith* names take sockaddr *'s as * parameters. - * - * This routine assumes that it will be called at splimp() or higher. */ /* ARGSUSED*/ void ifinit(dummy) void *dummy; { - register struct ifnet *ifp; + struct ifnet *ifp; + int s; + s = splimp(); for (ifp = ifnet.tqh_first; ifp; ifp = ifp->if_link.tqe_next) if (ifp->if_snd.ifq_maxlen == 0) { printf("%s%d XXX: driver didn't set ifq_maxlen\n", ifp->if_name, ifp->if_unit); ifp->if_snd.ifq_maxlen = ifqmaxlen; } + splx(s); if_slowtimo(0); } -- cgit v1.1