From owner-freebsd-net Fri Mar 15 13:15: 8 2002 Delivered-To: freebsd-net@freebsd.org Received: from iguana.icir.org (iguana.icir.org [192.150.187.36]) by hub.freebsd.org (Postfix) with ESMTP id 24CE237B405; Fri, 15 Mar 2002 13:15:04 -0800 (PST) Received: (from rizzo@localhost) by iguana.icir.org (8.11.6/8.11.3) id g2FLF4o92140; Fri, 15 Mar 2002 13:15:04 -0800 (PST) (envelope-from rizzo) Date: Fri, 15 Mar 2002 13:15:03 -0800 From: Luigi Rizzo To: net@FreeBSD.ORG Subject: Re: recent change to netinet/in.c panics bootp kernels w/ >1 interface Message-ID: <20020315131503.E91788@iguana.icir.org> References: <20020315130030.B91788@iguana.icir.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20020315130030.B91788@iguana.icir.org> User-Agent: Mutt/1.3.23i Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org As a followup, this seems to fix the problem, if there are no objections I am going to commit this soon. cheers luigi > lcvs diff -u bootp_subr.c Index: bootp_subr.c =================================================================== RCS file: /home/ncvs/src/sys/nfs/Attic/bootp_subr.c,v retrieving revision 1.20.2.7 diff -u -r1.20.2.7 bootp_subr.c --- bootp_subr.c 1 Feb 2002 17:22:55 -0000 1.20.2.7 +++ bootp_subr.c 15 Mar 2002 21:08:16 -0000 @@ -1044,10 +1044,11 @@ ifctx->broadcast.sin_addr.s_addr = sin->sin_addr.s_addr; error = ifioctl(so, SIOCSIFBRDADDR, (caddr_t)ireq, procp); - if (error != 0) + if (error != 0 && error != EADDRNOTAVAIL) panic("bootpc_fakeup_interface: " "set if broadcast addr, error=%d", error); + error = 0; /* Get HW address */ @@ -1109,7 +1110,7 @@ sin = (struct sockaddr_in *) &ireq->ifr_addr; clear_sinaddr(sin); error = ifioctl(so, SIOCDIFADDR, (caddr_t) ireq, procp); - if (error != 0 && (error != EEXIST || + if (error != 0 && (error != EADDRNOTAVAIL || ifctx == gctx->interfaces)) panic("bootpc_adjust_interface: " "SIOCDIFADDR, error=%d", error); On Fri, Mar 15, 2002 at 01:00:30PM -0800, Luigi Rizzo wrote: > The part shown below of a recent commit to in.c (1.60->1.61, > MFC'ed as 1.44.2.7 -> 1.44.2.8) always causes a panic when > using 'options BOOTP' on a system with more than 1 interface. ... > This was noticed by Doug Ambrisko who nailed down the problem > to this commit. > > Now, I see two possibilities for a fix here: either move the new > block after the EEXIST check (but this would nullify its effects), > or add checks in sys/nfs/bootpc_subr.c to ignore errors from > ifioctl (the EEXIST is apparently mapped into EADDRNOTAVAIL), > as it used to be in the past. Of course, hoping that > the "ia->ia_addr = oldaddr;" assignment does not cause other > problems. > > I can work on the latter, the problem is rather critical > and urgent to fix as it basically breaks most diskless setups. > > thanks > luigi To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message