Subject: Fw: Re: tcp connections lost on interface down
To: None <tech-net@netbsd.org>
From: Jun-ichiro itojun Hagino <itojun@itojun.org>
List: tech-net
Date: 08/05/2003 20:44:21
--NextPart-20030805204417-2801600


--NextPart-20030805204417-2801600
Content-Type: Message/Rfc822

Delivery-Date: Tue Aug  5 18:18:24 2003
To: Love <lha@stacken.kth.se>
Cc: Root <root@theforest.plus.com>, current-users@NetBSD.org
Subject: Re: tcp connections lost on interface down 
Cc: itojun@iijlab.net
From: Jun-ichiro itojun Hagino <itojun@iijlab.net>
In-reply-to: lha's message of Tue, 05 Aug 2003 01:48:22 +0200. <am3cghgf21.fsf@nutcracker.stacken.kth.se> 
Date: Tue, 05 Aug 2003 18:18:09 +0900
Sender: itojun@itojun.org
Message-Id: <20030805091809.1EAE1793@starfruit.itojun.org>

	(not sure if it is delivered, so i'll resend)

>> 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--