Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 15 Mar 2002 14:28:59 -0800 (PST)
From:      Doug Ambrisko <ambrisko@ambrisko.com>
To:        Luigi Rizzo <rizzo@icir.org>
Cc:        net@FreeBSD.ORG
Subject:   Re: recent change to netinet/in.c panics bootp kernels w/ >1 interface
Message-ID:  <200203152228.g2FMSxg43104@ambrisko.com>
In-Reply-To: <20020315131503.E91788@iguana.icir.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Luigi Rizzo writes:
| 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.

That fixes the panic and makes the first interface work.  However,
I recall it used to send BOOTP/DHCP request out on all interfaces and
indeed it claims to:
  IPsec: Initialized Security Association Processing.
  ad0: 19092MB <WDC WD200EB-00BHF0> [38792/16/63] at ata0-master UDMA100
  Sending DHCP Discover packet from interface sis0 (00:e0:18:50:d5:54)
  Sending DHCP Discover packet from interface fxp0 (00:02:b3:39:2f:c8)
  bootpc_call: sosend: 51 state 00000000
  Sending DHCP Discover packet from interface faith0 (00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00)

however, a packet capture via a connect to fxp0 showed that was not the
case.  The packets seem to be only going out the first interface.  The
others are ignored.

I also seem to have run into a bug with the 630ET support and netbooting
via Etherboot.  Linux/Etherboot does
	SIS_SETBIT(sc, SIS_CSR, SIS_CSR_ACCESS_MODE);
Adding:
	if (sc->sis_rev == SIS_REV_630ET)
		SIS_CLRBIT(sc, SIS_CSR, SIS_CSR_ACCESS_MODE);
to the FreeBSD driver fixes this.  Seems like FreeBSD driver does not
using this mode or it can't detect the PHYS.

I'm going to do some more tests with this and then commit that.

Doug A.

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?200203152228.g2FMSxg43104>