Subject: Re: Fw: Re: tcp connections lost on interface down
To: None <tech-net@netbsd.org>
From: None <itojun@iijlab.net>
List: tech-net
Date: 08/16/2003 20:29:20
	i will commit the following change, as it is rather extreme
	to shutdown connections when IP address goes away.  DHCP/PPP-based
	fixed address allocation suffers with this change.

itojun

>
>>> I'm not sure if this is a bug or intentional, but I have noticed that when
>>> ppp0 dies (due to disconnect - deliberate or otherwise), all the TCP
>>> connections are also lost. I have moved back to the kernel which does not
>>> have this problem.
>>Apprently its a feature. I don't like it. The idea is fine, I want to know
>>when the address of the connected sockets goes away, its just to
>>aggressive right now.
>
>	i think so too, it is too aggressive i think (think of DHCP/PPP-based
>	fixed address allocation like above).  the following diff should avoid
>	the behavior (not tested).  could we at least make it switchable via
>	sysctl, or remove this portion?
>
>itojun
>
>
>Index: in.c
>===================================================================
>RCS file: /cvsroot/src/sys/netinet/in.c,v
>retrieving revision 1.89
>diff -u -r1.89 in.c
>--- in.c	2003/06/26 03:35:00	1.89
>+++ in.c	2003/08/05 01:41:46
>@@ -568,6 +568,7 @@
> 			IFAREF(&nia->ia_ifa); 
> 			LIST_INSERT_HEAD(&nia->ia_inpcbs, inp, inp_ialink);
> 		} else if (inp->inp_socket != NULL) {
>+#if 0
> 			if ((inp->inp_socket->so_state & SS_NOFDREF) &&
> 			    inp->inp_socket->so_head == NULL) {
> 				soabort(inp->inp_socket);
>@@ -576,6 +577,7 @@
> 				sorwakeup(inp->inp_socket);
> 				sowwakeup(inp->inp_socket);
> 			}
>+#endif
> 		}
> 	}
> 
>
>--NextPart-20030805204417-2801600--