public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: andrew may <acmay@acmay.homeip.net>
To: Deepinder Singh <dsingh@somanetworks.com>
Cc: George Bonser <george@gator.com>, linux-kernel@vger.kernel.org
Subject: Re: Memory leaks with GRE Tunnels
Date: Fri, 1 Feb 2002 20:29:08 -0800	[thread overview]
Message-ID: <20020201202908.C12028@ecam.san.rr.com> (raw)
In-Reply-To: <CHEKKPICCNOGICGMDODJKEHPGDAA.george@gator.com> <3C599DBC.2040802@somanetworks.com>
In-Reply-To: <3C599DBC.2040802@somanetworks.com>

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);
                }


  reply	other threads:[~2002-02-02  4:29 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-01-31 18:33 Memory leaks with GRE Tunnels Deepinder Singh
2002-01-31 18:57 ` George Bonser
2002-01-31 19:40   ` Deepinder Singh
2002-02-02  4:29     ` andrew may [this message]
2002-01-31 20:49   ` Olaf Titz
2002-01-31 19:35 ` David Ford

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20020201202908.C12028@ecam.san.rr.com \
    --to=acmay@acmay.homeip.net \
    --cc=dsingh@somanetworks.com \
    --cc=george@gator.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox