Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Fri, 1 Feb 2002 23:29:34 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Fri, 1 Feb 2002 23:29:21 -0500 Received: from 24-25-196-177.san.rr.com ([24.25.196.177]:47378 "HELO acmay.homeip.net") by vger.kernel.org with SMTP id ; Fri, 1 Feb 2002 23:29:10 -0500 Date: Fri, 1 Feb 2002 20:29:08 -0800 From: andrew may To: Deepinder Singh Cc: George Bonser , linux-kernel@vger.kernel.org Subject: Re: Memory leaks with GRE Tunnels Message-ID: <20020201202908.C12028@ecam.san.rr.com> In-Reply-To: <3C599DBC.2040802@somanetworks.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0pre3us In-Reply-To: <3C599DBC.2040802@somanetworks.com> Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org I don't think there is a kernel problem, there is an ioctl to delete tunnels and it does work. if tun0 down does not delete the tunnel you need to send down the ioctl as well. I don't know what user tools do this for you, I have always done my own. This is all the code ryou really need { struct ifreq ifr; int fd; int i=0; if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) { SYSLOG(LOG_DAEMON | LOG_ERR, "Cannot open socket to close tunnel(s)\n"); return; } sprintf(ifr.ifr_name,"tun%d", i); if( (ioctl(fd, SIOCDELTUNNEL, &ifr) < 0) { SYSLOG(LOG_DAEMON | LOG_ERR, "Can't DELTUNNEL %s (%m)\n", ifr.ifr_name); } - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/