[8055] in Athena Bugs

home help back first fref pref prev next nref lref last post

RFC 1122: Net/Host unreach.

daemon@ATHENA.MIT.EDU (Richard Basch)
Wed Aug 28 01:17:21 1991

Date: Wed, 28 Aug 91 01:17:22 -0400
To: bugs@MIT.EDU
Cc: network@MIT.EDU
From: "Richard Basch" <basch@MIT.EDU>


Well, I have made modifications that I think may solve the problem of
dropping connections when random ICMP Net/Host Unreachables are received
from the routers.

I have not tested this well, but simple TCP connections do seem to work,
and telnetting to bogus hosts (123.123.123.123) seem to return Network
Unreachables instantly.

Does anyone have suggestions as to how to test it, or want to look this
over?  Ted, I know you were interested...  Have you been plagued with
this problem enough to be a good test case?  I have rarely seen this
problem personally.

-R


*** /tmp/,RCSt1Pw8B8e	Wed Aug 28 01:02:23 1991
--- netinet/tcp_subr.c	Tue Aug 27 18:43:11 1991
***************
*** 295,300 ****
--- 295,336 ----
  #endif
  		break;
  
+ 	case PRC_HOSTDEAD:
+ 	case PRC_HOSTUNREACH:
+ 		/*
+ 		 * These errors are normally hints by the routers, but
+ 		 * should not be used authoritatively.  We will use
+ 		 * them to abort a connection, but ignore sending them
+ 		 * up to the application layer in the middle of a
+ 		 * stream, as many applications do not deal properly.
+ 		 */
+ 		if (inetctlerrmap[cmd] == 0)
+ 			return;		/* XXX */
+ 		{
+ 		    /*
+ 		     * This is extracted from the in_pcbnotify() routine.
+ 		     * The original routine did not allow you to test for
+ 		     * the socket connection state.
+ 		     */
+ 		    register struct inpcb *inp, *oinp;
+ 		    int s = splimp();
+ 
+ 		    for (inp = tcb.inp_next; inp != &tcb;) {
+ 			if (inp->inp_faddr.s_addr != sin->sin_addr.s_addr ||
+ 			    inp->inp_socket == 0 ||
+ 			    inp->inp_socket->so_state & SS_ISCONNECTED) {
+ 			    inp = inp->inp_next;
+ 			    continue;
+ 			}
+ 			inp->inp_socket->so_error = (int)inetctlerrmap[cmd];
+ 			oinp = inp;
+ 			inp = inp->inp_next;
+ 			tcp_notify(oinp);
+ 		    }
+ 		    splx(s);
+ 		}
+ 		break;
+ 
  	default:
  		if (inetctlerrmap[cmd] == 0)
  			return;		/* XXX */

home help back first fref pref prev next nref lref last post