Messages in this thread | | | Date | Fri, 1 Feb 2002 20:29:08 -0800 | From | andrew may <> | Subject | Re: Memory leaks with GRE Tunnels |
| |
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/
| |