Subject: kern/1159: UDP connected sockets are not getting ICMP unreachable errors.
To: None <gnats-admin@sun-lamp.pc.cs.cmu.edu>
From: None <ziff@eecs.umich.edu>
List: netbsd-bugs
Date: 06/26/1995 03:20:05
>Number: 1159
>Category: kern
>Synopsis: UDP connected sockets are not getting ICMP unreachable errors.
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: kern-bug-people (Kernel Bug People)
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Mon Jun 26 03:20:03 1995
>Originator: Brian Moore
>Organization:
Home base
>Release: June 25, 1995
>Environment:
System: NetBSD brimo.oz.net 1.0A NetBSD 1.0A (MUNCH.NEW) #0: Sun Jun 25 22:15:49
PDT 1995 root@brimo.oz.net:/usr/src/sys/arch/i386/compile/MUNCH.NEW i386
>Description:
This bug first surfaced with the route add ?? localhost command that is
called at boot from /etc/rc. If you have a local name server configured through
/etc/resolv.conf with the lookup being set to bind file, this command will delay
the machine a very long time waiting for the name server to time out. This is
happening because the call to select in res_send is timing out now, rather than
( /usr/src/lib/libc/net/res_send.c ) is timing out rather than returning after
the socket receives an ICMP port unreachable message. The select call in a
kernel built around the 11th of June was returning right when the ICMP message
was received and the subsequent recv call would return -1 with an errno of
(ECONNREFUSED)
>How-To-Repeat:
Do 'route delete `hostname` localhost. Create a file /etc/resolv.conf
with a nameserver line that points to a machine that doesn't have a
named running. Now do a 'route add `hostname` localhost. The route
command will take a long time to time out. Try this with a kernel
that was built around the 11th of June and the route command will
time out very quickly.
>Fix:
A work around for right now is to have 'lookup file bind' in your
/etc/resolv.conf ( this was suggested by Michael VanLoon ) This bug
will still get tweaked if your name server ever goes down, rather than
returning quickly after getting the port unreachable message, it
will go through the time-out logic. This bug might also get tweaked
by other programs that use the ICMP port unreachable message, but I
don't know of any off-hand.
I was only able to get this debugged down to the kernel interface, I
don't know how to debug things at the kernel level. My guess is that
the problem is in the recent changes to /sys/netinet/*, in maybe
icmp_input, udp_ctlinput, in_pcbnotify or udp_notify(all).
Here are some ktrace's of the current kernel and the one built on June 11. The
kernel's uname -a output for the 6.11 kernel is:
NetBSD brimo.oz.net 1.0A NetBSD 1.0A (MUNCH.NEW) #0: Sun Jun 11 23:43:46 PDT 199
5 root@munch.eecs.umich.edu:/usr/src/sys/arch/i386/compile/MUNCH.NEW i386
---- ktrace.6.11 ----
12398 ktrace RET ktrace 0
12398 ktrace CALL __sysctl(0xf7bfd53c,0x2,0xb09c,0xf7bfd544,0,0)
12398 ktrace RET __sysctl 4
12398 ktrace CALL break(0xb0d4)
12398 ktrace RET break 0
12398 ktrace CALL break(0xbffc)
12398 ktrace RET break 0
12398 ktrace CALL break(0xcffc)
12398 ktrace RET break 0
12398 ktrace CALL execve(0xf7bfd5a0,0xf7bfd9fc,0xf7bfda10)
12398 ktrace NAMI "/sbin/route"
12398 route RET execve 0
12398 route CALL getpid
12398 route RET getpid 12398/0x306e
12398 route CALL getuid
12398 route RET getuid 0
12398 route CALL socket(0x11,0x3,0)
12398 route RET socket 3
12398 route CALL shutdown(0x3,0)
12398 route RET shutdown 0
12398 route CALL open(0x95f6,0,0x1b6)
12398 route NAMI "/etc/networks"
12398 route RET open -1 errno 2 No such file or directory
12398 route CALL open(0x95f6,0,0x1b6)
12398 route NAMI "/etc/networks"
12398 route RET open -1 errno 2 No such file or directory
12398 route CALL open(0xd370,0,0x1b6)
12398 route NAMI "/etc/resolv.conf"
12398 route RET open 4
12398 route CALL fstat(0x4,0xf7bfcc30)
12398 route RET fstat 0
12398 route CALL __sysctl(0xf7bfcc6c,0x2,0x1d0b0,0xf7bfcc74,0,0)
12398 route RET __sysctl 4
12398 route CALL break(0x1d504)
12398 route RET break 0
12398 route CALL break(0x1dffc)
12398 route RET break 0
12398 route CALL break(0x20ffc)
12398 route RET break 0
12398 route CALL read(0x4,0x1e000,0x2000)
12398 route GIO fd 4 read 86 bytes
"nameserver 141.213.5.56
search oz.net eecs.umich.edu engin.umich.edu
lookup bind file
"
12398 route RET read 86/0x56
12398 route CALL read(0x4,0x1e000,0x2000)
12398 route GIO fd 4 read 0 bytes
""
12398 route RET read 0
12398 route CALL close(0x4)
12398 route RET close 0
12398 route CALL socket(0x2,0x2,0)
12398 route RET socket 4
12398 route CALL connect(0x4,0x1aaf4,0x10)
12398 route RET connect 0
12398 route CALL sendto(0x4,0xf7bfceb4,0x1e,0,0,0)
12398 route GIO fd 4 wrote 30 bytes
"\0\^A\^A\0\0\^A\0\0\0\0\0\0\^Ebrimo\^Boz\^Cnet\0\0\^A\0\^A"
12398 route RET sendto 30/0x1e
12398 route CALL select(0x5,0xf7bfce70,0,0,0xf7bfcc54)
12398 route RET select 1
12398 route CALL recvfrom(0x4,0xf7bfd544,0x400,0,0,0)
12398 route RET recvfrom -1 errno 61 Connection refused
12398 route CALL sendto(0x4,0xf7bfceb4,0x1e,0,0,0)
12398 route GIO fd 4 wrote 30 bytes
"\0\^A\^A\0\0\^A\0\0\0\0\0\0\^Ebrimo\^Boz\^Cnet\0\0\^A\0\^A"
12398 route RET sendto 30/0x1e
12398 route CALL select(0x5,0xf7bfce70,0,0,0xf7bfcc54)
12398 route RET select 1
12398 route CALL recvfrom(0x4,0xf7bfd544,0x400,0,0,0)
12398 route RET recvfrom -1 errno 61 Connection refused
12398 route CALL sendto(0x4,0xf7bfceb4,0x1e,0,0,0)
12398 route GIO fd 4 wrote 30 bytes
"\0\^A\^A\0\0\^A\0\0\0\0\0\0\^Ebrimo\^Boz\^Cnet\0\0\^A\0\^A"
12398 route RET sendto 30/0x1e
12398 route CALL select(0x5,0xf7bfce70,0,0,0xf7bfcc54)
12398 route RET select 1
12398 route CALL recvfrom(0x4,0xf7bfd544,0x400,0,0,0)
12398 route RET recvfrom -1 errno 61 Connection refused
12398 route CALL sendto(0x4,0xf7bfceb4,0x1e,0,0,0)
12398 route GIO fd 4 wrote 30 bytes
"\0\^A\^A\0\0\^A\0\0\0\0\0\0\^Ebrimo\^Boz\^Cnet\0\0\^A\0\^A"
12398 route RET sendto 30/0x1e
12398 route CALL select(0x5,0xf7bfce70,0,0,0xf7bfcc54)
12398 route RET select 1
12398 route CALL recvfrom(0x4,0xf7bfd544,0x400,0,0,0)
12398 route RET recvfrom -1 errno 61 Connection refused
12398 route CALL close(0x4)
12398 route RET close 0
12398 route CALL socket(0x2,0x2,0)
12398 route RET socket 4
12398 route CALL connect(0x4,0x1aaf4,0x10)
12398 route RET connect 0
12398 route CALL sendto(0x4,0xf7bfceb4,0x25,0,0,0)
12398 route GIO fd 4 wrote 37 bytes
"\0\^B\^A\0\0\^A\0\0\0\0\0\0\^Ebrimo\^Boz\^Cnet\^Boz\^Cnet\0\0\^A\0\^A"
12398 route RET sendto 37/0x25
12398 route CALL select(0x5,0xf7bfce70,0,0,0xf7bfcc54)
12398 route RET select 1
12398 route CALL recvfrom(0x4,0xf7bfd544,0x400,0,0,0)
12398 route RET recvfrom -1 errno 61 Connection refused
12398 route CALL sendto(0x4,0xf7bfceb4,0x25,0,0,0)
12398 route GIO fd 4 wrote 37 bytes
"\0\^B\^A\0\0\^A\0\0\0\0\0\0\^Ebrimo\^Boz\^Cnet\^Boz\^Cnet\0\0\^A\0\^A"
12398 route RET sendto 37/0x25
12398 route CALL select(0x5,0xf7bfce70,0,0,0xf7bfcc54)
12398 route RET select 1
12398 route CALL recvfrom(0x4,0xf7bfd544,0x400,0,0,0)
12398 route RET recvfrom -1 errno 61 Connection refused
12398 route CALL sendto(0x4,0xf7bfceb4,0x25,0,0,0)
12398 route GIO fd 4 wrote 37 bytes
"\0\^B\^A\0\0\^A\0\0\0\0\0\0\^Ebrimo\^Boz\^Cnet\^Boz\^Cnet\0\0\^A\0\^A"
12398 route RET sendto 37/0x25
12398 route CALL select(0x5,0xf7bfce70,0,0,0xf7bfcc54)
12398 route RET select 1
12398 route CALL recvfrom(0x4,0xf7bfd544,0x400,0,0,0)
12398 route RET recvfrom -1 errno 61 Connection refused
12398 route CALL sendto(0x4,0xf7bfceb4,0x25,0,0,0)
12398 route GIO fd 4 wrote 37 bytes
"\0\^B\^A\0\0\^A\0\0\0\0\0\0\^Ebrimo\^Boz\^Cnet\^Boz\^Cnet\0\0\^A\0\^A"
12398 route RET sendto 37/0x25
12398 route CALL select(0x5,0xf7bfce70,0,0,0xf7bfcc54)
12398 route RET select 1
12398 route CALL recvfrom(0x4,0xf7bfd544,0x400,0,0,0)
12398 route RET recvfrom -1 errno 61 Connection refused
12398 route CALL close(0x4)
12398 route RET close 0
12398 route CALL open(0x5f8c,0,0x1b6)
12398 route NAMI "/etc/hosts"
12398 route RET open 4
12398 route CALL fstat(0x4,0xf7bfd444)
12398 route RET fstat 0
12398 route CALL read(0x4,0x1e000,0x2000)
12398 route GIO fd 4 read 131 bytes
"127.0.0.1 localhost.oz.net localhost loghost
204.118.241.121 brimo.oz.net brimo.oz brimo
198.68.184.66 liv.oz.net liv.oz liv
"
12398 route RET read 131/0x83
12398 route CALL close(0x4)
12398 route RET close 0
12398 route CALL open(0x95f6,0,0x1b6)
12398 route NAMI "/etc/networks"
12398 route RET open -1 errno 2 No such file or directory
12398 route CALL open(0x95f6,0,0x1b6)
12398 route NAMI "/etc/networks"
12398 route RET open -1 errno 2 No such file or directory
12398 route CALL socket(0x2,0x2,0)
12398 route RET socket 4
12398 route CALL connect(0x4,0x1aaf4,0x10)
12398 route RET connect 0
12398 route CALL sendto(0x4,0xf7bfceb4,0x22,0,0,0)
12398 route GIO fd 4 wrote 34 bytes
"\0\^C\^A\0\0\^A\0\0\0\0\0\0 localhost\^Boz\^Cnet\0\0\^A\0\^A"
12398 route RET sendto 34/0x22
12398 route CALL select(0x5,0xf7bfce70,0,0,0xf7bfcc54)
12398 route RET select 1
12398 route CALL recvfrom(0x4,0xf7bfd544,0x400,0,0,0)
12398 route RET recvfrom -1 errno 61 Connection refused
12398 route CALL sendto(0x4,0xf7bfceb4,0x22,0,0,0)
12398 route GIO fd 4 wrote 34 bytes
"\0\^C\^A\0\0\^A\0\0\0\0\0\0 localhost\^Boz\^Cnet\0\0\^A\0\^A"
12398 route RET sendto 34/0x22
12398 route CALL select(0x5,0xf7bfce70,0,0,0xf7bfcc54)
12398 route RET select 1
12398 route CALL recvfrom(0x4,0xf7bfd544,0x400,0,0,0)
12398 route RET recvfrom -1 errno 61 Connection refused
12398 route CALL sendto(0x4,0xf7bfceb4,0x22,0,0,0)
12398 route GIO fd 4 wrote 34 bytes
"\0\^C\^A\0\0\^A\0\0\0\0\0\0 localhost\^Boz\^Cnet\0\0\^A\0\^A"
12398 route RET sendto 34/0x22
12398 route CALL select(0x5,0xf7bfce70,0,0,0xf7bfcc54)
12398 route RET select 1
12398 route CALL recvfrom(0x4,0xf7bfd544,0x400,0,0,0)
12398 route RET recvfrom -1 errno 61 Connection refused
12398 route CALL sendto(0x4,0xf7bfceb4,0x22,0,0,0)
12398 route GIO fd 4 wrote 34 bytes
"\0\^C\^A\0\0\^A\0\0\0\0\0\0 localhost\^Boz\^Cnet\0\0\^A\0\^A"
12398 route RET sendto 34/0x22
12398 route CALL select(0x5,0xf7bfce70,0,0,0xf7bfcc54)
12398 route RET select 1
12398 route CALL recvfrom(0x4,0xf7bfd544,0x400,0,0,0)
12398 route RET recvfrom -1 errno 61 Connection refused
12398 route CALL close(0x4)
12398 route RET close 0
12398 route CALL open(0x5f8c,0,0x1b6)
12398 route NAMI "/etc/hosts"
12398 route RET open 4
12398 route CALL fstat(0x4,0xf7bfd444)
12398 route RET fstat 0
12398 route CALL read(0x4,0x1e000,0x2000)
12398 route GIO fd 4 read 131 bytes
"127.0.0.1 localhost.oz.net localhost loghost
204.118.241.121 brimo.oz.net brimo.oz brimo
198.68.184.66 liv.oz.net liv.oz liv
"
12398 route RET read 131/0x83
12398 route CALL close(0x4)
12398 route RET close 0
12398 route CALL write(0x3,0x1d264,0x6c)
12398 route GIO fd 3 wrote 108 bytes
"l\0\^C\^A\0\0\0\0\a\b\0\0\^C\0\0\0\0\0\0\0\^A\0\0\0\0\0\0\0\0\0\0\0\0\
\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\
\0\0\0\0\0\0\0\0\^P\^B\0\0\M-Lv\M-qy\0\0\0\0\0\0\0\0\^P\^B\0\0\^?\0\0\
\^A\0\0\0\0\0\0\0\0"
12398 route RET write 108/0x6c
12398 route CALL fstat(0x1,0xf7bfd680)
12398 route RET fstat 0
12398 route CALL break(0x25ffc)
12398 route RET break 0
12398 route CALL ioctl(0x1,TIOCGETA,0xf7bfd6bc)
12398 route RET ioctl 0
12398 route CALL write(0x1,0x21000,0x29)
12398 route GIO fd 1 wrote 41 bytes
"add host brimo.oz.net: gateway localhost
"
12398 route RET write 41/0x29
12398 route CALL exit(0)
----- ktrace.current -----
553 ktrace RET ktrace 0
553 ktrace CALL __sysctl(0xf7bfd518,0x2,0xb09c,0xf7bfd520,0,0)
553 ktrace RET __sysctl 4
553 ktrace CALL break(0xb0d4)
553 ktrace RET break 0
553 ktrace CALL break(0xbffc)
553 ktrace RET break 0
553 ktrace CALL break(0xcffc)
553 ktrace RET break 0
553 ktrace CALL execve(0xf7bfd57c,0xf7bfd9d8,0xf7bfd9ec)
553 ktrace NAMI "/sbin/route"
553 route RET execve 0
553 route CALL getpid
553 route RET getpid 553/0x229
553 route CALL getuid
553 route RET getuid 0
553 route CALL socket(0x11,0x3,0)
553 route RET socket 3
553 route CALL shutdown(0x3,0)
553 route RET shutdown 0
553 route CALL open(0x984e,0,0x1b6)
553 route NAMI "/etc/networks"
553 route RET open -1 errno 2 No such file or directory
553 route CALL open(0x984e,0,0x1b6)
553 route NAMI "/etc/networks"
553 route RET open -1 errno 2 No such file or directory
553 route CALL open(0xb000,0,0x1b6)
553 route NAMI "/etc/resolv.conf"
553 route RET open 4
553 route CALL fstat(0x4,0xf7bfcc08)
553 route RET fstat 0
553 route CALL __sysctl(0xf7bfcc44,0x2,0x1af84,0xf7bfcc4c,0,0)
553 route RET __sysctl 4
553 route CALL break(0x1b3d8)
553 route RET break 0
553 route CALL break(0x1bffc)
553 route RET break 0
553 route CALL break(0x1effc)
553 route RET break 0
553 route CALL read(0x4,0x1c000,0x2000)
553 route GIO fd 4 read 86 bytes
"nameserver 141.213.5.56
search oz.net eecs.umich.edu engin.umich.edu
lookup bind file
"
553 route RET read 86/0x56
553 route CALL read(0x4,0x1c000,0x2000)
553 route GIO fd 4 read 0 bytes
""
553 route RET read 0
553 route CALL close(0x4)
553 route RET close 0
553 route CALL socket(0x2,0x2,0)
553 route RET socket 4
553 route CALL connect(0x4,0x18928,0x10)
553 route RET connect 0
553 route CALL sendto(0x4,0xf7bfce8c,0x1e,0,0,0)
553 route GIO fd 4 wrote 30 bytes
"\0\^A\^A\0\0\^A\0\0\0\0\0\0\^Ebrimo\^Boz\^Cnet\0\0\^A\0\^A"
553 route RET sendto 30/0x1e
553 route CALL select(0x5,0xf7bfce50,0,0,0xf7bfcc34)
553 route RET select 0
553 route CALL sendto(0x4,0xf7bfce8c,0x1e,0,0,0)
553 route GIO fd 4 wrote 30 bytes
"\0\^A\^A\0\0\^A\0\0\0\0\0\0\^Ebrimo\^Boz\^Cnet\0\0\^A\0\^A"
553 route RET sendto 30/0x1e
553 route CALL select(0x5,0xf7bfce50,0,0,0xf7bfcc34)
553 route RET select 0
553 route CALL sendto(0x4,0xf7bfce8c,0x1e,0,0,0)
553 route GIO fd 4 wrote 30 bytes
"\0\^A\^A\0\0\^A\0\0\0\0\0\0\^Ebrimo\^Boz\^Cnet\0\0\^A\0\^A"
553 route RET sendto 30/0x1e
553 route CALL select(0x5,0xf7bfce50,0,0,0xf7bfcc34)
553 route RET select 0
553 route CALL sendto(0x4,0xf7bfce8c,0x1e,0,0,0)
553 route GIO fd 4 wrote 30 bytes
"\0\^A\^A\0\0\^A\0\0\0\0\0\0\^Ebrimo\^Boz\^Cnet\0\0\^A\0\^A"
553 route RET sendto 30/0x1e
553 route CALL select(0x5,0xf7bfce50,0,0,0xf7bfcc34)
553 route PSIG SIGINT SIG_DFL
Here are some tcpdumps from the two kernels.
--- tcpdump.6.11 ---
21:34:35.046338 204.118.241.121.1067 > 141.213.5.56.53: 1+ A? brimo.oz.net. (30)
21:34:35.310124 141.213.5.56 > 204.118.241.121: icmp: 141.213.5.56 udp port 53 unreachable
21:34:35.310649 204.118.241.121.1067 > 141.213.5.56.53: 1+ A? brimo.oz.net. (30)
21:34:35.570372 141.213.5.56 > 204.118.241.121: icmp: 141.213.5.56 udp port 53 unreachable
21:34:35.571109 204.118.241.121.1067 > 141.213.5.56.53: 1+ A? brimo.oz.net. (30)
21:34:35.830364 141.213.5.56 > 204.118.241.121: icmp: 141.213.5.56 udp port 53 unreachable
21:34:35.830951 204.118.241.121.1067 > 141.213.5.56.53: 1+ A? brimo.oz.net. (30)
21:34:36.100181 141.213.5.56 > 204.118.241.121: icmp: 141.213.5.56 udp port 53 unreachable
21:34:36.102097 204.118.241.121.1068 > 141.213.5.56.53: 2+ (37)
21:34:36.360395 141.213.5.56 > 204.118.241.121: icmp: 141.213.5.56 udp port 53 unreachable
21:34:36.361160 204.118.241.121.1068 > 141.213.5.56.53: 2+ (37)
21:34:36.630164 141.213.5.56 > 204.118.241.121: icmp: 141.213.5.56 udp port 53 unreachable
21:34:36.631599 204.118.241.121.1068 > 141.213.5.56.53: 2+ (37)
21:34:36.910233 141.213.5.56 > 204.118.241.121: icmp: 141.213.5.56 udp port 53 unreachable
21:34:36.910955 204.118.241.121.1068 > 141.213.5.56.53: 2+ (37)
21:34:37.180206 141.213.5.56 > 204.118.241.121: icmp: 141.213.5.56 udp port 53 unreachable
21:34:37.202183 204.118.241.121.1069 > 141.213.5.56.53: 3+ A? localhost.oz.net. (34)
21:34:37.470233 141.213.5.56 > 204.118.241.121: icmp: 141.213.5.56 udp port 53 unreachable
21:34:37.470991 204.118.241.121.1069 > 141.213.5.56.53: 3+ A? localhost.oz.net. (34)
21:34:37.740354 141.213.5.56 > 204.118.241.121: icmp: 141.213.5.56 udp port 53 unreachable
21:34:37.741130 204.118.241.121.1069 > 141.213.5.56.53: 3+ A? localhost.oz.net. (34)
21:34:38.000321 141.213.5.56 > 204.118.241.121: icmp: 141.213.5.56 udp port 53 unreachable
21:34:38.001053 204.118.241.121.1069 > 141.213.5.56.53: 3+ A? localhost.oz.net. (34)
21:34:38.260326 141.213.5.56 > 204.118.241.121: icmp: 141.213.5.56 udp port 53 unreachable
---- tcpdump-current ----
00:04:32.541668 204.118.241.121.1064 > 141.213.5.56.53: 1+ A? brimo.oz.net. (30)
00:04:32.830150 141.213.5.56 > 204.118.241.121: icmp: 141.213.5.56 udp port 53 u
nreachable
00:04:37.830621 204.118.241.121.1064 > 141.213.5.56.53: 1+ A? brimo.oz.net. (30)
00:04:38.100189 141.213.5.56 > 204.118.241.121: icmp: 141.213.5.56 udp port 53 u
nreachable
00:04:48.100578 204.118.241.121.1064 > 141.213.5.56.53: 1+ A? brimo.oz.net. (30)
00:04:48.370085 141.213.5.56 > 204.118.241.121: icmp: 141.213.5.56 udp port 53 u
nreachable
00:05:08.370759 204.118.241.121.1064 > 141.213.5.56.53: 1+ A? brimo.oz.net. (30)
00:05:08.630253 141.213.5.56 > 204.118.241.121: icmp: 141.213.5.56 udp port 53 u
nreachable
>Audit-Trail:
>Unformatted: