From owner-freebsd-net Tue Jun 5 8:14: 0 2001 Delivered-To: freebsd-net@freebsd.org Received: from khavrinen.lcs.mit.edu (khavrinen.lcs.mit.edu [18.24.4.193]) by hub.freebsd.org (Postfix) with ESMTP id 79B3937B405 for ; Tue, 5 Jun 2001 08:13:56 -0700 (PDT) (envelope-from wollman@khavrinen.lcs.mit.edu) Received: (from wollman@localhost) by khavrinen.lcs.mit.edu (8.9.3/8.9.3) id LAA87829; Tue, 5 Jun 2001 11:13:27 -0400 (EDT) (envelope-from wollman) Date: Tue, 5 Jun 2001 11:13:27 -0400 (EDT) From: Garrett Wollman Message-Id: <200106051513.LAA87829@khavrinen.lcs.mit.edu> To: Jesper Skriver Cc: freebsd-net@FreeBSD.ORG Subject: leaking route structures, please review In-Reply-To: <20010605145104.A68594@skriver.dk> References: <20010605145104.A68594@skriver.dk> Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org < said: > Since rt was the cached route of the pcb, the ref count is >= 1 > since the pcb will have a ref count on it. In the case of a dynamic > route, in_losing calls rtrequest to delete the route but not rtfree. > rtrequest() only deletes the route from the routing table. It does > not free the route structure unless rt_refcnt is 0. This is correct. We can't have it rip the route out from under any number of PCBs and other routes which may have it referenced. > We know it won't be zero because the pcb has a ref count. As a > result it appears that we leak a route structure since it will never > be freed. No, the next time that route structure is used, the lack of an RTF_UP flag on the route will be noted, and the reference will be dropped before rtalloc() is called to find the new correct route. If you want the references to be dropped sooner, either send more traffic or close your connections more frequently. -GAWollman To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message