[HELP] Strange 'ping localhost' results

Gary Anderson (ganderson@ganderson-ppp.clark.net)
Sat, 25 Jan 1997 12:43:59 -0500 (EST)


I posted this a couple of weeks ago, and didn't see any responses, so am
trying again, hoping someone out there will recognize this.

I've noticed something that has me rather puzzled. When I 'ping
localhost', all looks quite normal, but when I look at the ifconfig, only
the transmitted packet count is incremented, the receive packet count
stays at '0'. Receive packet counts for other interfaces (ppp0 &
eth0) are incremented normally.

Here's the vitals:
kernel 1.2.13
libc-5.0.9
bind-4.9.3-REL
proc_ps-0.97u2

Output of 'ping localhost'
root@ganderson-ppp:/home/ganderson# ping localhost
PING localhost (127.0.0.1): 56 data bytes
--- localhost ping statistics ---
5 packets transmitted, 5 packets received, 0% packet loss
round-trip min/avg/max = 1.2/1.4/2.3 ms

Output of 'ifconfig':
lo Link encap:Local Loopback
inet addr:127.0.0.1 Bcast:127.255.255.255 Mask:255.0.0.0
UP BROADCAST LOOPBACK RUNNING MTU:2000 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0
TX packets:13326 errors:0 dropped:0 overruns:0

ppp0 Link encap:Point-Point Protocol
inet addr:168.143.0.103 P-t-P:207.97.80.3 Mask:255.255.0.0
UP BROADCAST POINTOPOINT RUNNING MTU:576 Metric:1
RX packets:8928 errors:0 dropped:0 overruns:0
TX packets:10167 errors:0 dropped:0 overruns:0

eth0 Link encap:10Mbps Ethernet HWaddr 00:A0:24:26:E0:38
inet addr:192.168.1.103 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0
TX packets:0 errors:0 dropped:0 overruns:0
Interrupt:10 Base address:0x300
(( Hadn't brought up the single machine at the other end of eth0 ))

Output of 'route -n'
Kernel routing table
Destination Gateway Genmask Flags MSS Window Use Iface
127.0.0.1 * 255.255.255.255 UH 1936 0 24026 lo
192.168.1.103 * 255.255.255.255 UH 1436 4096 0 eth0
192.168.1.104 * 255.255.255.255 UH 1436 4096 1097 eth0
207.97.80.3 * 255.255.255.255 UH 512 0 0 ppp0
192.168.1.0 * 255.255.255.0 U 1436 0 0 eth0
127.0.0.0 * 255.0.0.0 U 1936 0 0 lo
default 207.97.80.3 * UG 512 0 16 ppp0

Here is my rc.net1 file:
#! /bin/sh
#
# This is: /etc/rc.d/rc.net1
#

echo "Setting up ifconfig for loopback"
if [ -x /sbin/ifconfig ]; then
/sbin/ifconfig lo localhost
fi

# Set up the primary (static) routes.
if [ -x /sbin/route ]; then
echo "Setting route for loopback"
/sbin/route add 127.0.0.1
/sbin/route add -net 127.0.0.0 netmask 255.0.0.0 lo
fi

'lo' entry from /proc/net/dev:
Inter-| Receive | Transmit
face |packets errs drop fifo frame|packets errs drop fifo colls carrier
lo: 0 0 0 0 0 23476 0 0 0 0 0

I _occasionally_ see this in the log file (doesn't happen every time I
ping localhost). I run a caching-only named on this machine.:
(This may be due to the fact that ownership on named is 'bin.bin')
Nov 13 15:42:32 ganderson-ppp icmpinfo: ICMP_Dest_Unreachable[Port] \
< 127.0.0.1 > 127.0.0.1 sp=53 dp=1131 seq=0x00bd2ac2 sz=36(+20)

root@ganderson-ppp:/home/ganderson# strace -f -o mytrace -s 255 ping -c 2 -d localhost
PING localhost (127.0.0.1): 56 data bytes
64 bytes from 127.0.0.1: icmp_seq=0 ttl=255 time=27.5 ms
64 bytes from 127.0.0.1: icmp_seq=1 ttl=255 time=17.1 ms
--- localhost ping statistics ---
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max = 17.1/22.3/27.5 ms

Output of the strace: (Please excuse the long lines)
3315 open("", O_RDONLY) = 4
3315 mmap(0, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE, 4, 0) = 0x50006000
3315 close(4) = 0
3315 mprotect(0x50000000, 17128, PROT_READ|PROT_WRITE|PROT_EXEC) = 0
3315 getuid() = 0
3315 geteuid() = 0
3315 getgid() = 0
3315 getegid() = 0
3315 stat("", {st_mode=S_IFREG|0644, st_size=2569, ...}) = 0
3315 open("/etc/ld.so.cache", O_RDONLY) = 4
3315 mmap(0, 2569, PROT_READ, MAP_SHARED, 4, 0) = 0x50007000
3315 close(4) = 0
3315 munmap(0x50007000, 2569) = 0
3315 open("/lib/libc.so.5.0.9", O_RDONLY) = 4
3315 open("/dev/zero", O_RDONLY) = 5
3315 read(4, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0000\330\0\0004\0\0\0\230\375\7\0\0\0\0\0004\0 \0\3\0(\0\30\0\25\0\1\0\0\0\224\0\0\0\224\0\0\0\0\0\0\0\375v\7\0\375v\7\0\5\0\0\0\0\20\0\0\1\0\0\0\230w\7\0\230\207\7\0\0\0\0\0\374E\0\0\340i\3\0\6

\0\0\0\0\20\0\0"..., 4096) = 4096
3315 mmap(0, 720896, PROT_NONE, MAP_PRIVATE, 5, 0) = 0x50007000
3315 mmap(0x50007000, 489361, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 4, 0) = 0x50007000
3315 mmap(0x5007f000, 19860, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 4, 0x77000) = 0x5007f000
3315 mmap(0x50084000, 205176, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 5, 0) = 0x50084000
3315 close(5) = 0
3315 close(4) = 0
3315 mprotect(0x50007000, 489361, PROT_READ|PROT_WRITE|PROT_EXEC) = 0
3315 mprotect(0x50007000, 489361, PROT_READ|PROT_EXEC) = 0
3315 mprotect(0x50000000, 17128, PROT_READ|PROT_EXEC) = 0
3315 SYS_136(0, 0x5, 0x14, 0x50000000, 0x50000850) = 0
3315 brk(0) = 0x8015000
3315 brk(0x8018000) = 0x8018000
3315 brk(0x8019000) = 0x8019000
3315 brk(0x801a000) = 0x801a000
3315 brk(0x801b000) = 0x801b000
3315 open("/share/locale/C/LC_MESSAGES", O_RDONLY) = -1 ENOENT (No such file or directory)
3315 brk(0x801c000) = 0x801c000
3315 stat("/etc/locale/C/libc.cat", 0xbffff6bc) = -1 ENOENT (No such file or directory)
3315 stat("/usr/lib/locale/C/libc.cat", 0xbffff6bc) = -1 ENOENT (No such file or directory)
3315 stat("/usr/lib/locale/libc/C", 0xbffff6bc) = -1 ENOENT (No such file or directory)
3315 stat("/usr/share/locale/C/libc.cat", 0xbffff6bc) = -1 ENOENT (No such file or directory)
3315 stat("/usr/local/share/locale/C/libc.cat", 0xbffff6bc) = -1 ENOENT (No such file or directory)
3315 open("/etc/host.conf", O_RDONLY) = 4
3315 fstat(4, {st_mode=S_IFREG|0644, st_size=220, ...}) = 0
3315 brk(0x801d000) = 0x801d000
3315 read(4, "# searching order .. scan /etc/hosts, then try the name server\norder hosts,bind\nmulti on\n# set domain\n# domain clark.net\n# disable sub-domain search\n# search .\n# talk to the local named daemon\n# nameserver 168.143.0.103\n", 1024) =

220
3315 read(4, "", 1024) = 0
3315 close(4) = 0
3315 open("/etc/resolv.conf", O_RDONLY) = 4
3315 fstat(4, {st_mode=S_IFREG|0644, st_size=38, ...}) = 0
3315 read(4, "search clark.net\nnameserver 127.0.0.1\n", 1024) = 38
3315 read(4, "", 1024) = 0
3315 close(4) = 0
3315 uname({sys="Linux", node="ganderson-ppp.clark.net", ...}) = 0
3315 open("/etc/hosts", O_RDONLY) = 4
3315 fstat(4, {st_mode=S_IFREG|0644, st_size=2149, ...}) = 0
3315 read(4, "# Hosts file: names of the local hosts (see explanation below).\n#\n# Local Hosts Format:\n# IP_NUMBER\t\tHOSTNAME\tALIASES\n#\n# Local host loopback ip numbers\n127.0.0.1\t\tlocalhost\n127.0.0.0\t\tloopnet\n#\n# Here is the name of your h

ost, first, fol"..., 1024) = 1024
3315 read(4, "clark.net\n168.143.0.2\t\tclarknet.clark.net\tnews.clark.net\n168.143.0.10\t\tmail.clark.net\t\tpop3.clark.net\n#\n# ClarkNet DNS\n#\n198.17.243.2\t\tsun1.clark.net\n168.143.0.3\t\tallison.clark.net\n#\n# ClarkNet Routers\n#\n168.143.0.1\t\

trouter.clark.n"..., 1024) = 1024
3315 read(4, "---------------------------------------------------------------\n#18.86.0.44\t\ttsx-11.mit.edu\t\t\ttsx-11\n", 1024) = 101
3315 read(4, "", 1024) = 0
3315 close(4) = 0
3315 getpid() = 3315
3315 open("/etc/protocols", O_RDONLY) = 4
3315 fstat(4, {st_mode=S_IFREG|0444, st_size=715, ...}) = 0
3315 read(4, "#\n# protocols\tThis file describes the various protocols that are\n#\t\tavailable from the TCP/IP subsystem. It should be\n#\t\tconsulted instead of using the numbers in the ARPA\n#\t\tinclude files, or, worse, just guessing them.\n#\n# V

ersion:\t@(#)/e"..., 1024) = 715
3315 lseek(4, -283, SEEK_CUR) = 432
3315 close(4) = 0
3315 socket(PF_INET, SOCK_RAW, IPPROTO_ICMP) = 4
3315 setsockopt(4, SOL_SOCKET, SO_DEBUG, [1], 4) = 0
3315 setsockopt(4, SOL_SOCKET, SO_RCVBUF, [49152], 4) = 0
3315 fstat(1, {st_mode=S_IFCHR|0600, st_rdev=makedev(4, 194), ...}) = 0
3315 ioctl(1, TCGETS, {B9600 opost isig icanon echo ...}) = 0
3315 write(1, "PING localhost (127.0.0.1): 56 data bytes\n", 42) = 42
3315 sigaction(SIGINT, {0x8001f30, [], SA_INTERRUPT|SA_NOMASK|SA_ONESHOT}, {SIG_DFL}) = 0
3315 sigaction(SIGALRM, {0x80015a0, [], SA_INTERRUPT|SA_NOMASK|SA_ONESHOT}, {SIG_DFL}) = 0
3315 gettimeofday({853075377, 733425}, NULL) = 0
3315 sendto(4, "\10\0\223\246\363\f\0\0\261\345\3302\3610\v\0\10\t\n\v\f\r\16\17\20\21\22\23\24\25\26\27\30\31\32\33\34\35\36\37 !\"#$%&\'()*+,-./01234567", 64, 0, {sin_family=AF_INET, sin_port=htons(0), sin_addr=inet_addr("127.0.0.1")}, 16) = 64
3315 sigaction(SIGALRM, {0x80015a0, [], SA_INTERRUPT|SA_NOMASK|SA_ONESHOT}, {0x80015a0, [], SA_INTERRUPT|SA_NOMASK|SA_ONESHOT}) = 0
3315 alarm(1) = 0
3315 recvfrom(4, "E\0\0T\346\225\0\0@\1\226\21\177\0\0\1\177\0\0\1\10\0\223\246\363\f\0\0\261\345\3302\3610\v\0\10\t\n\v\f\r\16\17\20\21\22\23\24\25\26\27\30\31\32\33\34\35\36\37 !\"#$%&\'()*+,-./01234567", 192, 0, {sin_family=AF_INET, sin_port=htons(0),

sin_addr=inet_addr("127.0.0.1")}, [16]) = 84
3315 gettimeofday({853075377, 756909}, NULL) = 0
3315 recvfrom(4, "E\0\0T\346\226\0\0\377\1\327\17\177\0\0\1\177\0\0\1\0\0\233\246\363\f\0\0\261\345\3302\3610\v\0\10\t\n\v\f\r\16\17\20\21\22\23\24\25\26\27\30\31\32\33\34\35\36\37 !\"#$%&\'()*+,-./01234567", 192, 0, {sin_family=AF_INET, sin_port=htons(0

), sin_addr=inet_addr("127.0.0.1")}, [16]) = 84
3315 gettimeofday({853075377, 760936}, NULL) = 0
3315 write(1, "64 bytes from 127.0.0.1: icmp_seq=0 ttl=255 time=27.5 ms\n", 57) = 57
3315 recvfrom(4, 0x801bf00, 192, 0, 0xbffffb90, 0xbffffb8c) = ? ERESTARTSYS (To be restarted)
3315 --- SIGALRM (Alarm clock) ---
3315 gettimeofday({853075378, 743588}, NULL) = 0
3315 sendto(4, "\10\0\336~\363\f\1\0\262\345\3302\244X\v\0\10\t\n\v\f\r\16\17\20\21\22\23\24\25\26\27\30\31\32\33\34\35\36\37 !\"#$%&\'()*+,-./01234567", 64, 0, {sin_family=AF_INET, sin_port=htons(0), sin_addr=inet_addr("127.0.0.1")}, 16) = 64
3315 sigaction(SIGALRM, {0x80015a0, [], SA_INTERRUPT|SA_NOMASK|SA_ONESHOT}, {SIG_DFL}) = 0
3315 sigaction(SIGALRM, {0x8001f30, [], SA_INTERRUPT|SA_NOMASK|SA_ONESHOT}, {0x80015a0, [], SA_INTERRUPT|SA_NOMASK|SA_ONESHOT}) = 0
3315 alarm(1) = 0
3315 sigreturn() = ? (mask now [])
3315 recvfrom(4, "E\0\0T\346\227\0\0@\1\226\17\177\0\0\1\177\0\0\1\10\0\336~\363\f\1\0\262\345\3302\244X\v\0\10\t\n\v\f\r\16\17\20\21\22\23\24\25\26\27\30\31\32\33\34\35\36\37 !\"#$%&\'()*+,-./01234567", 192, 0, {sin_family=AF_INET, sin_port=htons(0), si

n_addr=inet_addr("127.0.0.1")}, [16]) = 84
3315 gettimeofday({853075378, 756783}, NULL) = 0
3315 recvfrom(4, "E\0\0T\346\230\0\0\377\1\327\r\177\0\0\1\177\0\0\1\0\0\346~\363\f\1\0\262\345\3302\244X\v\0\10\t\n\v\f\r\16\17\20\21\22\23\24\25\26\27\30\31\32\33\34\35\36\37 !\"#$%&\'()*+,-./01234567", 192, 0, {sin_family=AF_INET, sin_port=htons(0), s

in_addr=inet_addr("127.0.0.1")}, [16]) = 84
3315 gettimeofday({853075378, 760758}, NULL) = 0
3315 write(1, "64 bytes from 127.0.0.1: icmp_seq=1 ttl=255 time=17.1 ms\n", 57) = 57
3315 sigaction(SIGINT, {SIG_IGN}, {0x8001f30, [], SA_INTERRUPT|SA_NOMASK|SA_ONESHOT}) = 0
3315 write(1, "\n", 1) = 1
3315 write(1, "--- localhost ping statistics ---\n", 34) = 34
3315 write(1, "2 packets transmitted, 2 packets received, 0% packet loss\n", 58) = 58
3315 write(1, "round-trip min/avg/max = 17.1/22.3/27.5 ms\n", 43) = 43
3315 _exit(0) = ?