From owner-freebsd-mobile Wed Dec 8 14:58:52 1999 Delivered-To: freebsd-mobile@freebsd.org Received: from onoe2.sm.sony.co.jp (onoe2.sm.sony.co.jp [133.138.10.2]) by hub.freebsd.org (Postfix) with ESMTP id 6188415247 for ; Wed, 8 Dec 1999 14:58:47 -0800 (PST) (envelope-from onoe@sm.sony.co.jp) Received: from duplo.sm.sony.co.jp (onoe@localhost) by onoe2.sm.sony.co.jp (8.9.0/3.7W) with ESMTP id HAA19617; Thu, 9 Dec 1999 07:58:36 +0900 (JST) Received: (from onoe@localhost) by duplo.sm.sony.co.jp (8.9.3/8.9.3) id HAA26803; Thu, 9 Dec 1999 07:59:02 +0900 (JST) Date: Thu, 9 Dec 1999 07:59:02 +0900 (JST) From: Atsushi Onoe Message-Id: <199912082259.HAA26803@duplo.sm.sony.co.jp> To: imp@village.org Cc: joe@pavilion.net, mobile@freebsd.org Subject: Re: Recent changes to pccard, pcic, etc. In-Reply-To: Your message of "Wed, 08 Dec 1999 11:06:23 -0700" <199912081806.LAA05338@harmony.village.org> References: <199912081806.LAA05338@harmony.village.org> X-Mailer: Cue version 0.6 (991117-1133/onoe) Mime-Version: 1.0 Content-Type: Multipart/Mixed; boundary="NextPart-19991209075740-1025200" Sender: owner-freebsd-mobile@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org --NextPart-19991209075740-1025200 Content-Type: Text/Plain; charset=us-ascii > FYI, I jut got a panic w/o dhcp in the ip_input on my machine. I > suspect that dhcp makes it worse, but other things can trigger it as > well. Calling if_detach() for interfaces with address causes the inconsistency, and re-assigning new address for the interface, e.g. dhcp, makes it worse. Perhaps you could avoid the problem if you delete all address *before* you remove the card and *before* you suspend the PC. Or you can try my ad hoc patch attached. Though it is not the right fix, it works fine for me even with dhcp. Atsushi --NextPart-19991209075740-1025200 Content-Type: text/plain; charset=us-ascii Content-Description: Ad hoc patch for if_detach() Content-Disposition: attachment; filename="if_detach.patch" *** net/if.c.ORG Wed Dec 8 02:39:03 1999 --- net/if.c Thu Dec 9 07:54:47 1999 *************** *** 227,238 **** --- 227,258 ---- * Remove address from ifnet_addrs[] and maybe decrement if_index. * Clean up all addresses. */ + #if 1 /* ONOE */ + ifnet_addrs[ifp->if_index - 1] = 0; + while (if_index > 0 && ifnet_addrs[if_index - 1] == 0) + if_index--; + #else /* ONOE */ ifnet_addrs[ifp->if_index] = 0; while (ifnet_addrs[if_index] == 0) if_index--; + #endif /* ONOE */ for (ifa = TAILQ_FIRST(&ifp->if_addrhead); ifa; ifa = TAILQ_FIRST(&ifp->if_addrhead)) { + #if 1 /* ONOE */ + /* XXX: Ugly!! ad hoc just for INET */ + if (ifa->ifa_addr && ifa->ifa_addr->sa_family == AF_INET) { + struct ifaliasreq ifr; + + bzero(&ifr, sizeof(ifr)); + if (ifa->ifa_addr) + ifr.ifra_addr = *ifa->ifa_addr; + if (ifa->ifa_dstaddr) + ifr.ifra_broadaddr = *ifa->ifa_dstaddr; + if (in_control(NULL, SIOCDIFADDR, (caddr_t)&ifr, ifp, NULL) == 0) + continue; + } + #endif /* ONOE */ TAILQ_REMOVE(&ifp->if_addrhead, ifa, ifa_link); IFAFREE(ifa); } --NextPart-19991209075740-1025200-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-mobile" in the body of the message