Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 16 Aug 2009 13:46:09 GMT
From:      Marko Zec <zec@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 167404 for review
Message-ID:  <200908161346.n7GDk9rK068136@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=167404

Change 167404 by zec@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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200908161346.n7GDk9rK068136>