diff options
author | peter <peter@FreeBSD.org> | 1999-04-26 09:02:40 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 1999-04-26 09:02:40 +0000 |
commit | e29be9ada8c29f05c864d7820481379f0a86ddff (patch) | |
tree | 1c1538cc203a8f221ac905dfbe7b9b9781dc26a9 /sys | |
parent | 0f064f457903a041df445610cfea375e7eb8baee (diff) | |
download | FreeBSD-src-e29be9ada8c29f05c864d7820481379f0a86ddff.zip FreeBSD-src-e29be9ada8c29f05c864d7820481379f0a86ddff.tar.gz |
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..
Diffstat (limited to 'sys')
-rw-r--r-- | sys/net/if.c | 9 |
1 files changed, 5 insertions, 4 deletions
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); } |