Subject: Re: Cobalt kernel with ramdisk?
To: Soren S. Jorvang <soren@wheel.dk>
From: Andrew Gillham <gillhaa@ghost.whirlpool.com>
List: port-cobalt
Date: 04/03/2000 18:14:49
Soren S. Jorvang writes:
> On Mon, Apr 03, 2000 at 04:50:55PM -0400, Andrew Gillham wrote:
> > For some reason I can't get a NFS root to work correctly.  I can load
> > the kernel ok, but then it times out on the DHCP.  So apparently the
> > firmware can DHCP, but NetBSD can't.  I did see a couple of 'tlp' related
> > commits recently, but I'm assuming your latest kernel has them.  Using
> > tcpdump, I don't seen any packets from NetBSD during the DHCP attempt.
> 
> Hmm. Could you send me the kernel output?

Ok, I think the problem is that NetBSD is apparently setting TTL to '1' on
the bootp packet.
I used tcpdump on a host on the same segment, and here is the successful
packet:
17:49:40.015931 0.0.0.0.bootpc > 255.255.255.255.bootps: xid:0x66c64f51 secs:5 [|bootp]

Unsuccessful packet:
17:50:10.820071 0.0.0.0.bootpc > 255.255.255.255.bootps: xid:0x1ffffff [|bootp] [ttl 1]

Apparently nfs_bootdhcp.c sets "SO_DONTROUTE", which causes ip_output.c
to do this: (or am I missing something?)
        /*
         * If routing to interface only,
         * short circuit routing lookup.
         */
        if (flags & IP_ROUTETOIF) {
                if ((ia = ifatoia(ifa_ifwithladdr(sintosa(dst)))) == 0) {
                        ipstat.ips_noroute++;
                        error = ENETUNREACH;
                        goto bad;
                }
                ifp = ia->ia_ifp;
                mtu = ifp->if_mtu;
                ip->ip_ttl = 1;
                ^^^^^^^^^^^^^^

So, it looks like BOOTP/DHCP packets end up with a TTL of 1, which IMHO
is wrong.  

Any ideas on the correct fix?

-Andrew
-- 
-----------------------------------------------------------------
Andrew Gillham                            | NetBSD ist Affengeil.
gillham@whirlpool.com                     | Nachts ist es kaelter
I speak for myself, not for my employer.  | als draussen.