Subject: Re: DHCP and RoadRunner Cable Modem
To: NetBSD i386 <port-i386@netbsd.org>
From: Analysis and Solutions <info@analysisandsolutions.com>
List: port-i386
Date: 07/11/2001 23:16:27
Hey Folks:

Analysis and Solutions wrote:
> 
> Hi Chris:
> 
> Chris Pinnock wrote:
> >
> > You would be better off grabbing the entire "syssrc" source for
> > NetBSD-release-1-5 (i.e. the kernel sources) using CVS or ftp or whatever.
> 
> Many thanks for the pointers.  Went ahead and did it.  My cable modem
> connection is now working!
> 
> So, to recap, a bug in NetBSD's driver for my PCI network card was keeping me
> from connecting to the net.  A tip for the future, if your network card's
> MAC/NIC number to show up wrong in the operating system, there's probably a
> driver bug.

Heh.  I spoke too soon.  The DHCP network connection got established the
first time I booted the machine.  Then, I installed the tcsh package and did
some other configuration tasks then rebooted and it stopped working.

When starting "dhclient sip0" here's the error message that sticks out like a
sore thumb:

    DHCPREQUEST on sip0 to 255.255.255.255 port 67
    ip length 328 disagrees with bytes received 330.
    accepting packet with data after udp payload.

When this warning appears, pinging to the "bound to" works, but it takes a
long time to display the output, but do note, the ping turnaround times are
all normal.  But trying to ping a remote IP address goes nowhere.

After much hacking away at possible rc.conf and dhclient.conf combinations
and messing around with other DHCP related files, I figured I'd reinstall.

Downloaded the 20010516-1.5.1_BETA2 snapshot.  Killed the old installation. 
Did a completely fresh install.  DHCP worked fine.  Until I started changing
things, including conf files and adding tcsh via pkg_add.

So again, I reinstalled.  Rebooted.  Typed "dhclient sip0."  Worked fine. 
For testing sake, I did another reboot/dhclient startup.  Looking good.  Then
I edited my rc.conf file to add
   hostname="base.nyc.rr.com"
Reboot, startup dhclient, and landed in the same decrepit boat.  So, again,
in an attempt to track down what's going on, I do another reboot/dhclient
cycle.  No dice.  Hmm, let's restore all of the /etc files to their original
state, then reboot the machine and do dhclient again.  Nope.  ARGH!  Time to
go to bed.

The next day, restart and do a "dhclient sip0" and it works!  HUH????? 
Sanity check... do this once more and it works.  Do it again and it doesn't! 
Shutdown, restart and do dhclient again and it's fine.  Hmm, let's try doing
kill -15 to the dhclient PID then restart it.  Comes up fine a couple times. 
Now, let's install tcsh through pkg_add.  Went fine.  Can still ping the
outside world nicely.  Change my shell and login, still getting outside IP's
okay.  Kill and restart dhclient a couple times.  No sweat.  Okay, the moment
of truth.  Shutdown and restart the machine.  Enter dhclient sip0.  Blamo. 
Same garbage.  Do five rounds of shutting down the machine and restarting
dhclient.  No luck.

Okay, I'm crazy, let's do this again.  Kill the partition, and do a full
reinstall.  Dhclient works on the first boot.  Subsequent boots, no luck.  Do
a kill -15 on dhclient.  Write, then run, the following script:
  #!/bin/sh
  rm -rf /etc
  cp -RpL /etc.orig /etc
  rm /var/db/dhclient.leases
  rm /var/run/dhclient.pid
  echo done
Now shutdown, restart and dhclient sip0.  DAMN!

This has now been going on for days and days.  Through all my testing I've
been trying to pin it down to something in particular, so I'd be able to
report a bug, but I haven't been able to point to one thing as of yet.

Sean Davis was kind enough to send me a perl script which he uses to get
online via his RoadRunner connection.  It goes through
/var/db/dhclient.leases file and copies the data there into the
/etc/resolv.conf file and into system calls on the ifconfig and route
programs.  I haven't tested it because NetBSD should be able to do this on
it's own.

Do note, my network card uses the DP83815 chip which just had a driver bug
updated in NetBSD 1.5.1.  Perhaps it wasn't completely fixed?  Anyway, here's
my whole config:

 Machine         IBM 300GL, 6591-34U
 Processor       Pentium II 266
 RAM             256 mb
 BIOS Revision   NZJT42A
 Network Card    Netgear FA312 10/100 BaseT (PCI) (Chip: DP83815)
 Network         RoadRunner Cable Service
 Cable Modem     Toshiba PCX1100U
 PCI Controller  Intel FW82371AB F808YB11 SL23P
 IDE Controller  ATA-33 PCI 32-bit busmaster on planar
 Video Control.  Cirrus Logic GD5465-HC-C
 Sound Card      Creative Technologies CT2980 (ISA) (Chip: CT2502-SDQ)
 Printer         HP OfficeJet 600
  

===================  ifconfig -a  ===================
AFTER INSTALLING, BEFORE DOING DHCLIENT:
  sip0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> mtu 1500
	address: 00:a0:cc:a1:86:27
	media: Ethernet autoselect (10baseT)
	status: active

AFTER RUNNING DHCLIENT
(IT'S THE SAME REGARDLESS IF A GOOD LEASE IS GOTTEN OR NOT):
  sip0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
	address: 00:a0:cc:a1:86:27
	media: Ethernet autoselect (10baseT)
	status: active
	inet 24.29.146.199 netmask 0xffffff80 broadcast 255.255.255.255
	inet6 fe80::2a0:ccff:fea1:8627%sip0 prefixlen 64 scopeid 0x1
=====================================================

Thanks soooo much,

--Dan

-- 
                PHP scripts that make your job easier
              http://www.analysisandsolutions.com/code/
         SQL Solution  |  Layout Solution  |  Form Solution
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
 4015 7 Ave, Brooklyn NY 11232    v: 718-854-0335    f: 718-854-0409