Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-1-6]: src/sys/netinet Pull up revision 1.72 (requested by itojun ...



details:   https://anonhg.NetBSD.org/src/rev/36b90fd616cb
branches:  netbsd-1-6
changeset: 530463:36b90fd616cb
user:      grant <grant%NetBSD.org@localhost>
date:      Mon Jun 30 02:21:02 2003 +0000

description:
Pull up revision 1.72 (requested by itojun in ticket #1342):

cleanup multicast routing stuff on if_detach().

diffstat:

 sys/netinet/ip_mroute.c |  35 +++++++++++++++++++++++++++++++++--
 1 files changed, 33 insertions(+), 2 deletions(-)

diffs (56 lines):

diff -r e13aefdb5ceb -r 36b90fd616cb sys/netinet/ip_mroute.c
--- a/sys/netinet/ip_mroute.c   Mon Jun 30 02:20:32 2003 +0000
+++ b/sys/netinet/ip_mroute.c   Mon Jun 30 02:21:02 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ip_mroute.c,v 1.59.8.1 2002/08/02 00:39:23 lukem Exp $ */
+/*     $NetBSD: ip_mroute.c,v 1.59.8.2 2003/06/30 02:21:02 grant Exp $ */
 
 /*
  * Copyright (c) 1989 Stephen Deering
@@ -54,7 +54,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ip_mroute.c,v 1.59.8.1 2002/08/02 00:39:23 lukem Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_mroute.c,v 1.59.8.2 2003/06/30 02:21:02 grant Exp $");
 
 #include "opt_ipsec.h"
 
@@ -481,6 +481,37 @@
        return (0);
 }
 
+void
+ip_mrouter_detach(ifp)
+       struct ifnet *ifp;
+{
+       int vifi, i;
+       struct vif *vifp;
+       struct mfc *rt, *nrt;
+       struct rtdetq *rte, *nrte, **prte;
+
+       /* XXX not sure about sideeffect to userland routing daemon */
+       for (vifi = 0; vifi < numvifs; vifi++) {
+               vifp = &viftable[vifi];
+               if (vifp->v_ifp == ifp)
+                       reset_vif(vifp);
+       }
+       for (i = 0; i < MFCTBLSIZ; i++) {
+               for (rt = LIST_FIRST(&mfchashtbl[i]); rt; rt = nrt) {
+                       prte = &rt->mfc_stall;
+                       for (rte = *prte; rte; rte = nrte) {
+                               nrte = rte->next;
+                               if (rte->ifp == ifp) {
+                                       m_freem(rte->m);
+                                       free(rte, M_MRTABLE);
+                                       *prte = nrte;
+                               } else
+                                       prte = &rte->next;
+                       }
+               }
+       }
+}
+
 /*
  * Disable multicast routing
  */



Home | Main Index | Thread Index | Old Index