From owner-freebsd-net Fri Mar 15 13: 0:34 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 762E837B404; Fri, 15 Mar 2002 13:00:30 -0800 (PST) Received: (from rizzo@localhost) by iguana.icir.org (8.11.6/8.11.3) id g2FL0Ul92006; Fri, 15 Mar 2002 13:00:30 -0800 (PST) (envelope-from rizzo) Date: Fri, 15 Mar 2002 13:00:30 -0800 From: Luigi Rizzo To: net@freebsd.org Subject: recent change to netinet/in.c panics bootp kernels w/ >1 interface Message-ID: <20020315130030.B91788@iguana.icir.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 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. ad0: 15MB [490/2/32] at ata0-master BIOSPIO panic: bootpc_fakeup_interface: set if broadcast addr, error=49 Debugger("panic") Stopped at Debugger+0x34: movb $0,0xc03a7420 db> trace Debugger(c030677b) at Debugger+0x34 panic(c0310120,31,0,c08c7000,c08c5000) at panic+0x70 nfs_writebp(c08c7000,c08c5000,c03a9c80) at nfs_writebp+0x1059 bootpc_init(c03cfff8,c015fd68,0,3ccc00,3d4000) at bootpc_init+0x14b cpu_rootconf(0,3ccc00,3d4000,0,c01267d0) at cpu_rootconf+0x8 mi_startup(0,0,0,0,0) at mi_startup+0x68 btext() at btext+0xb0 db> 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 @@ -716,6 +725,12 @@ in_ifinit(ifp, ia, sin, scrub) } if ((error = rtinit(&(ia->ia_ifa), (int)RTM_ADD, flags)) == 0) ia->ia_flags |= IFA_ROUTE; + + if (error != 0 && ia->ia_dstaddr.sin_family == AF_INET) { + ia->ia_addr = oldaddr; + return (error); + } + /* XXX check if the subnet route points to the same interface */ if (error == EEXIST) error = 0; To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message