Subject: kern/4157: ping 'sendto' fails in single-user
To: None <gnats-bugs@gnats.netbsd.org>
From: None <gillhaa@ghost.whirlpool.com>
List: netbsd-bugs
Date: 09/25/1997 19:13:05
>Number:         4157
>Category:       kern
>Synopsis:       ping 'sendto' fails in single-user
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people (Kernel Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Sep 25 16:20:01 1997
>Last-Modified:
>Originator:     Andrew Gillham
>Organization:
-----------------------------------------------------------------
Andrew Gillham                            | This space left blank
gillham@whirlpool.com                     | inadvertently.
I speak for myself, not for my employer.  | Contact the publisher.
>Release:        970924
>Environment:
NetBSD 1.2G (SHADOW) #0: Wed Sep 24 01:26:47 EDT 1997
    root@shadow:/usr/src/sys/arch/i386/compile/SHADOW
cpu0: family 6 model 1 step 7
cpu0: Intel Pentium Pro (686-class)
real mem  = 66711552
avail mem = 52424704
using 1388 buffers containing 11370496 bytes of memory
mainbus0 (root)
pci0 at mainbus0 bus 0: configuration mode 1
pchb0 at pci0 dev 0 function 0
pchb0: Intel 82440FX (Natoma) PCI and Memory Controller (rev. 0x02)
pcib0 at pci0 dev 7 function 0
pcib0: Intel 82371SB (Triton II) PCI-ISA Bridge (rev. 0x01)
Intel 82371SB (Triton II) IDE controller (IDE mass storage, interface 0x80) at pci0 dev 7 function 1 not configured
bha0 at pci0 dev 11 function 0: BusLogic 9xxC SCSI
bha0: interrupting at irq 10
bha0: model BT-956C, firmware 4.28A
bha0: sync, parity
bha0 targ 0: sync, offset 14, period 100nsec
scsibus0 at bha0: 16 targets
sd0 at scsibus0 targ 0 lun 0: <MICROP, 3243-19MZ  Q4D, HT02> SCSI2 0/direct fixed
sd0: 4095MB, 3956 cyl, 19 head, 111 sec, 512 bytes/sect x 8388315 sectors
sd1 at scsibus0 targ 5 lun 0: <IOMEGA, ZIP 100, C.19> SCSI2 0/direct removable
sd1: drive offline
de0 at pci0 dev 15 function 0 at irq 9
de0: SMC 9332DST 21140 [10-100Mb/s] pass 1.1
de0: address 00:00:c0:00:53:bf
de0: enabling 100baseTX port
S3 86C968-0 ("Vision968") (VGA display) at pci0 dev 17 function 0 not configured
isa0 at pcib0
com0 at isa0 port 0x3f8-0x3ff irq 4: ns16550a, working fifo
com1 at isa0 port 0x2f8-0x2ff irq 3: ns16550a, working fifo
lpt0 at isa0 port 0x378-0x37b irq 7
wdc0 at isa0 port 0x1f0-0x1f7 irq 14
atapibus0 at wdc0
wd0 at wdc0 drive 0: <WDC AC32500H>
wd0: 2441MB, 4960 cyl, 16 head, 63 sec, 512 bytes/sec
wd0: using 16-sector 16-bit pio transfers, lba addressing
wdc1 at isa0 port 0x170-0x177 irq 15
atapibus1 at wdc1
cd0 at atapibus1 drive 0: <NEC                 CD-ROM DRIVE:282, , 3.04> type 5 cdrom removable
npx0 at isa0 port 0xf0-0xff: using exception 16
vt0 at isa0 port 0x60-0x6f irq 1
vt0: unknown s3, 80 col, color, 8 scr, mf2-kbd, [R3.32]
pms0 at vt0 irq 12
vt0: console
fdc0 at isa0 port 0x3f0-0x3f7 irq 6 drq 2
fd0 at fdc0 drive 0: 1.44MB, 80 cyl, 2 head, 18 sec
isapnp0 at isa0 port 0x279: read port 0x203
sb0 at isapnp0 port 0x220/16,0x330/2,0x388/4 irq 5 drq 1,5
sb0: Creative SB AWE32 PnP Audio: dsp v4.13
isapnp0: <Creative SB AWE32 PnP, PNPFFFF, , Reserved> port 0x100/1 not configured
isapnp0: <Creative SB AWE32 PnP, CTL0021, , WaveTable> port 0x620/4 not configured
joy0 at isapnp0 port 0x200/8
joy0: Creative SB AWE32 PnP Game
joy0: joystick not connected
isapnp0: <Creative SB AWE32 PnP, CTL0051, , StereoEnhance> port 0x100/1 not configured
biomask c440 netmask c640 ttymask d6c2
boot device: sd1
root on sd0a dumps on sd0b
de0: enabling 100baseTX port

>Description:
	When booted single-user, if the network 'de0' is configured
	ping fails with the following error:
	PING 158.52.19.254 (158.52.19.254): 56 data bytes
	64 bytes from 158.52.19.254: icmp_seq=0 ttl=255 time=1.585 ms
	ping: failed to clear cached route: Network is unreachable

	This occurs on the machine with the dmesg above, and on a 
	SparcStation 10 Model 30, and on a Tyan Tomcat I P133, so it
	appears to be general

>How-To-Repeat:
	boot -s
	fsck
	mount -a
	ifconfig de0 `cat /etc/ifconfig.de0`
	ping x.x.x.x   <- local machine on same ethernet wire

	The contents of ifconfig.de0 are:
	inet shadow netmask 255.255.255.0 media 100basetx 

>Fix:
	Do not have a fix.  Telnet works fine to the same ip address.
	Here is the output of ktrace on the SS10 for 'ping 158.52.19.254'

    40 ktrace   RET   ktrace 0
    40 ktrace   CALL  __sysctl(0xf7fff830,0x2,0xeb88,0xf7fff82c,0,0)
    40 ktrace   RET   __sysctl 0
    40 ktrace   CALL  break(0xebc8)
    40 ktrace   RET   break 0
    40 ktrace   CALL  break(0xeffc)
    40 ktrace   RET   break 0
    40 ktrace   CALL  break(0xfffc)
    40 ktrace   RET   break 0
    40 ktrace   CALL  execve(0xf7fff978,0xf7fffe50,0xf7fffe5c)
    40 ktrace   NAMI  "/sbin/ping"
    40 ping     EMUL  "netbsd"
    40 ping     RET   execve JUSTRETURN
    40 ping     CALL  ioctl(0,TIOCGETA,0xf7fffdd0)
    40 ping     RET   ioctl 0
    40 ping     CALL  ioctl(0,TIOCSETA,0xf7fffdd0)
    40 ping     RET   ioctl 0
    40 ping     CALL  gettimeofday(0xf7ffeff0,0)
    40 ping     RET   gettimeofday 0
    40 ping     CALL  getpid
    40 ping     RET   getpid 40/0x28
    40 ping     CALL  open(0x16fc8,0,0x1b6)
    40 ping     NAMI  "/etc/resolv.conf"
    40 ping     RET   open -1 errno 2 No such file or directory
    40 ping     CALL  __sysctl(0xf7ffeff0,0x2,0xf7fff070,0xf7ffefec,0,0)
    40 ping     RET   __sysctl 0
    40 ping     CALL  open(0x7630,0,0x1b6)
    40 ping     NAMI  "/etc/hosts"
    40 ping     RET   open 3
    40 ping     CALL  fstat(0x3,0xf7fff208)
    40 ping     RET   fstat 0
    40 ping     CALL  __sysctl(0xf7fff1f8,0x2,0x3fdb0,0xf7fff1f4,0,0)
    40 ping     RET   __sysctl 0
    40 ping     CALL  break(0x4090c)
    40 ping     RET   break 0
    40 ping     CALL  break(0x40ffc)
    40 ping     RET   break 0
    40 ping     CALL  break(0x43ffc)
    40 ping     RET   break 0
    40 ping     CALL  read(0x3,0x41000,0x2000)
    40 ping     GIO   fd 3 read 445 bytes
       "#	$NetBSD: hosts,v 1.4 1997/01/09 05:33:14 mikel Exp $
	#
	# Host Database
	# This file should contain the addresses and aliases
	# for local hosts that share this file.
	# It is used only for "ifconfig" and other operations
	# before the nameserver is started.
	#
	#
	127.0.0.1		localhost
	#
	# RFC 1918 specifies that these networks are "internal".
	# 10.0.0.0	10.255.255.255
	# 172.16.0.0	172.31.255.255
	# 192.168.0.0	192.168.255.255
	158.52.19.27 lanfear
       "
    40 ping     RET   read 445/0x1bd
    40 ping     CALL  read(0x3,0x41000,0x2000)
    40 ping     GIO   fd 3 read 0 bytes
       ""
    40 ping     RET   read 0
    40 ping     CALL  close(0x3)
    40 ping     RET   close 0
    40 ping     CALL  break(0x44ffc)
    40 ping     RET   break 0
    40 ping     CALL  getpid
    40 ping     RET   getpid 40/0x28
    40 ping     CALL  socket(0x2,0x3,0x1)
    40 ping     RET   socket 3
    40 ping     CALL  setsockopt(0x3,0,0x2,0xf7fffdc8,0x4)
    40 ping     RET   setsockopt 0
    40 ping     CALL  fstat(0x1,0xf7fff880)
    40 ping     RET   fstat 0
    40 ping     CALL  break(0x55ffc)
    40 ping     RET   break 0
    40 ping     CALL  ioctl(0x1,TIOCGETA,0xf7fff8b0)
    40 ping     RET   ioctl 0
    40 ping     CALL  write(0x1,0x45000,0x32)
    40 ping     GIO   fd 1 wrote 50 bytes
       "PING 158.52.19.254 (158.52.19.254): 56 data bytes
       "
    40 ping     RET   write 50/0x32
    40 ping     CALL  setsockopt(0x3,0xffff,0x1002,0x28070,0x4)
    40 ping     RET   setsockopt 0
    40 ping     CALL  setsockopt(0x3,0xffff,0x1001,0x28070,0x4)
    40 ping     RET   setsockopt 0
    40 ping     CALL  sigaction(0x2,0xf7fffd48,0xf7fffd38)
    40 ping     RET   sigaction 0
    40 ping     CALL  sigaction(0x1d,0xf7fffd48,0xf7fffd38)
    40 ping     RET   sigaction 0
    40 ping     CALL  sigaction(0x13,0xf7fffd48,0xf7fffd38)
    40 ping     RET   sigaction 0
    40 ping     CALL  gettimeofday(0x408d8,0)
    40 ping     RET   gettimeofday 0
    40 ping     CALL  gettimeofday(0x40900,0)
    40 ping     RET   gettimeofday 0
    40 ping     CALL  sendto(0x3,0x28910,0x54,0,0x3fdc0,0x10)
    40 ping     GIO   fd 3 wrote 84 bytes
       "E\0\0T\0\0\0\0\M^?\^A\0\0\0\0\0\0\M^^4\^S\M-~\b\0C\^F\0(\0\0004*\M-gG\
	\0\^N\M-.N\b	
	\v\f\r\^N\^O\^P\^Q\^R\^S\^T\^U\^V\^W\^X\^Y\^Z\^[\^\\^]\^^\^_ !"#$%&'()\
	*+,-./01234567"
    40 ping     RET   sendto 84/0x54
    40 ping     CALL  select(0x4,0xf7fffd20,0,0,0xf7fffd40)
    40 ping     RET   select 1
    40 ping     CALL  recvfrom(0x3,0x44000,0xc0,0,0xf7fffd48,0xf7fffd1c)
    40 ping     GIO   fd 3 read 84 bytes
       "E\0\0@\0\a\0\0\M^?\^A\0\0\M^^4\^S\M-~\M^^4\^S\^[\0\0K\^F\0(\0\0004*\
	\M-gG\0\^N\M-.N\b	
	\v\f\r\^N\^O\^P\^Q\^R\^S\^T\^U\^V\^W\^X\^Y\^Z\^[\^\\^]\^^\^_ !"#$%&'()\
	*+,-./01234567"
    40 ping     RET   recvfrom 84/0x54
    40 ping     CALL  gettimeofday(0x40900,0)
    40 ping     RET   gettimeofday 0
    40 ping     CALL  break(0x56ffc)
    40 ping     RET   break 0
    40 ping     CALL  write(0x1,0x45000,0x3e)
    40 ping     GIO   fd 1 wrote 62 bytes
       "64 bytes from 158.52.19.254: icmp_seq=0 ttl=255 time=2.279 ms
       "
    40 ping     RET   write 62/0x3e
    40 ping     CALL  gettimeofday(0x40900,0)
    40 ping     RET   gettimeofday 0
    40 ping     CALL  select(0x4,0xf7fffd20,0,0,0xf7fffd40)
    40 ping     RET   select 0
    40 ping     CALL  gettimeofday(0x40900,0)
    40 ping     RET   gettimeofday 0
    40 ping     CALL  select(0x4,0xf7fffd20,0,0,0xf7fffd40)
    40 ping     RET   select 0
    40 ping     CALL  gettimeofday(0x40900,0)
    40 ping     RET   gettimeofday 0
    40 ping     CALL  select(0x4,0xf7fffd20,0,0,0xf7fffd40)
    40 ping     RET   select 0
    40 ping     CALL  gettimeofday(0x40900,0)
    40 ping     RET   gettimeofday 0
    40 ping     CALL  setsockopt(0x3,0,0x2,0xf7fffca4,0x4)
    40 ping     RET   setsockopt 0
    40 ping     CALL  sendto(0x3,0x28924,0x8,0x4,0x40070,0x10)
    40 ping     RET   sendto -1 errno 51 Network is unreachable
    40 ping     CALL  write(0x2,0xf7fff370,0x6)
    40 ping     GIO   fd 2 wrote 6 bytes
       "ping: "
    40 ping     RET   write 6
    40 ping     CALL  write(0x2,0xf7fff3d8,0x1c)
    40 ping     GIO   fd 2 wrote 28 bytes
       "failed to clear cached route"
    40 ping     RET   write 28/0x1c
    40 ping     CALL  write(0x2,0xf7fff370,0x2)
    40 ping     GIO   fd 2 wrote 2 bytes
       ": "
    40 ping     RET   write 2
    40 ping     CALL  open(0xf7fff698,0,0x1)
    40 ping     NAMI  "/usr/share/nls/C/libc.cat"
    40 ping     RET   open 4
    40 ping     CALL  fstat(0x4,0xf7fff5d0)
    40 ping     RET   fstat 0
    40 ping     CALL  mmap(0,0xe5a,0x1,0x1,0x4,0,0,0)
    40 ping     RET   mmap 268599296/0x10028000
    40 ping     CALL  close(0x4)
    40 ping     RET   close 0
    40 ping     CALL  break(0x57ffc)
    40 ping     RET   break 0
    40 ping     CALL  munmap(0x10028000,0xe5a)
    40 ping     RET   munmap 0
    40 ping     CALL  write(0x2,0xf7fff370,0x17)
    40 ping     GIO   fd 2 wrote 23 bytes
       "Network is unreachable
       "
    40 ping     RET   write 23/0x17
    40 ping     CALL  exit(0x1)

>Audit-Trail:
>Unformatted: