Date: Sun, 6 Aug 2000 12:44:30 -0700 (PDT) From: Archie Cobbs <archie@whistle.com> To: Dennis <dennis@etinc.com> Cc: hackers@FreeBSD.ORG Subject: Re: ether_ifattach() issue Message-ID: <200008061944.MAA04098@bubba.whistle.com> In-Reply-To: <200008051445.KAA00231@etinc.com> from Dennis at "Aug 5, 2000 10:59:02 am"
next in thread | previous in thread | raw e-mail | index | archive | help
Dennis writes: > The change in 4.1 to ether_ifattach() needs a check to see if the device is > already attached. > > calling ether_ifattch() with a device already attached will lock up the > system consistently. No interface should be attached twice, Ethernet or other, right? So try this patch and find out which driver is broken. -Archie ___________________________________________________________________________ Archie Cobbs * Whistle Communications, Inc. * http://www.whistle.com Index: sys/net/if.c =================================================================== RCS file: /home/ncvs/src/sys/net/if.c,v retrieving revision 1.91 diff -u -r1.91 if.c --- if.c 2000/07/16 01:46:42 1.91 +++ if.c 2000/08/06 19:42:47 @@ -146,6 +146,17 @@ inited = 1; } +#ifdef INVARIANTS + { + struct ifnet *qent; + + TAILQ_FOREACH(qent, &ifnet, if_link) { + KASSERT(qent != ifp, ("%s%d: already attached", + ifp->if_name, ifp->if_unit)); + } + } +#endif + TAILQ_INSERT_TAIL(&ifnet, ifp, if_link); ifp->if_index = ++if_index; /* To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200008061944.MAA04098>