Hi,

I just saw this PR:
   http://www.freebsd.org/cgi/query-pr.cgi?pr=kern/100080

This patch appears to fix the problem. Any obvious glaring errors?

Testers please?

Regards,
BMS
Index: if_tun.c
===================================================================
RCS file: /home/ncvs/src/sys/net/if_tun.c,v
retrieving revision 1.161
diff -u -p -r1.161 if_tun.c
--- if_tun.c	6 Nov 2006 13:42:02 -0000	1.161
+++ if_tun.c	2 Feb 2007 23:30:04 -0000
@@ -388,16 +388,21 @@ tunclose(struct cdev *dev, int foo, int 
 		splx(s);
 	}
 
+	/* Delete all addresses and routes which reference this interface. */
 	if (ifp->if_drv_flags & IFF_DRV_RUNNING) {
 		struct ifaddr *ifa;
 
 		s = splimp();
-		/* find internet addresses and delete routes */
-		TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link)
-			if (ifa->ifa_addr->sa_family == AF_INET)
-				/* Unlocked read. */
+		TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
+			/* deal w/IPv4 PtP destination; unlocked read */
+			if (ifa->ifa_addr->sa_family == AF_INET) {
 				rtinit(ifa, (int)RTM_DELETE,
 				    tp->tun_flags & TUN_DSTADDR ? RTF_HOST : 0);
+			} else {
+				rtinit(ifa, (int)RTM_DELETE, 0);
+			}
+		}
+		if_purgeaddrs(ifp);
 		ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
 		splx(s);
 	}
_______________________________________________
freebsd-net@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to