PERFORCE change 167404 for review
    Marko Zec 
    zec at FreeBSD.org
       
    Sun Aug 16 13:46:10 UTC 2009
    
    
  
http://perforce.freebsd.org/chv.cgi?CH=167404
Change 167404 by zec at zec_tpx32 on 2009/08/16 13:45:51
	When moving ifnets from one vnet to another, and the ifnet
	has ifaddresses of AF_LINK type which thus have an embedded
	if_index "backpointer", we must update that one to reflect the
	new if_index that our ifnet just got assigned.
	Submitted by:	bz
Affected files ...
.. //depot/projects/vimage-commit2/src/sys/net/if.c#83 edit
Differences ...
==== //depot/projects/vimage-commit2/src/sys/net/if.c#83 (text+ko) ====
@@ -570,6 +570,17 @@
 		/* Reliably crash if used uninitialized. */
 		ifp->if_broadcastaddr = NULL;
 	}
+#ifdef VIMAGE
+	else {
+		for (ifa = ifp->if_addr; ifa != NULL;
+		    ifa = TAILQ_NEXT(ifa, ifa_link)) {
+			if (ifa->ifa_addr->sa_family == AF_LINK) {
+				sdl = (struct sockaddr_dl *)ifa->ifa_addr;
+				sdl->sdl_index = ifp->if_index;
+			}
+		}
+	}
+#endif
 
 	IFNET_WLOCK();
 	TAILQ_INSERT_TAIL(&V_ifnet, ifp, if_link);
    
    
More information about the p4-projects
mailing list