From owner-freebsd-hackers Sun Aug 6 12:45: 5 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from bubba.whistle.com (bubba.whistle.com [207.76.205.7]) by hub.freebsd.org (Postfix) with ESMTP id 327E037B5A3 for ; Sun, 6 Aug 2000 12:45:02 -0700 (PDT) (envelope-from archie@whistle.com) Received: (from archie@localhost) by bubba.whistle.com (8.9.3/8.9.3) id MAA04098; Sun, 6 Aug 2000 12:44:30 -0700 (PDT) (envelope-from archie) From: Archie Cobbs Message-Id: <200008061944.MAA04098@bubba.whistle.com> Subject: Re: ether_ifattach() issue In-Reply-To: <200008051445.KAA00231@etinc.com> from Dennis at "Aug 5, 2000 10:59:02 am" To: Dennis Date: Sun, 6 Aug 2000 12:44:30 -0700 (PDT) Cc: hackers@FreeBSD.ORG X-Mailer: ELM [version 2.4ME+ PL68 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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