Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 15 Mar 2002 13:00:30 -0800
From:      Luigi Rizzo <rizzo@icir.org>
To:        net@freebsd.org
Subject:   recent change to netinet/in.c panics bootp kernels w/ >1 interface
Message-ID:  <20020315130030.B91788@iguana.icir.org>

next in thread | raw e-mail | index | archive | help
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 <SunDisk SDCFB-16> [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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020315130030.B91788>