Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 15 Mar 2002 13:15:03 -0800
From:      Luigi Rizzo <rizzo@icir.org>
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>
In-Reply-To: <20020315130030.B91788@iguana.icir.org>
References:  <20020315130030.B91788@iguana.icir.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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




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