Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 29 Oct 2007 16:17:56 GMT
From:      Marko Zec <zec@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 128289 for review
Message-ID:  <200710291617.l9TGHuTM004074@repoman.freebsd.org>

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

Change 128289 by zec@zec_tca51 on 2007/10/29 16:17:16

	When reassigning ifnets from one vnet to another, use
	the new vimage_by_name() function to search for the
	target vimage / vnet.

Affected files ...

.. //depot/projects/vimage/src/sys/kern/kern_vimage.c#54 edit

Differences ...

==== //depot/projects/vimage/src/sys/kern/kern_vimage.c#54 (text+ko) ====

@@ -302,18 +302,12 @@
 		if (IS_DEFAULT_VIMAGE(vip))
 			return (ENXIO);
 		new_vnet = vip->vi_parent->v_net;
-	} else
-		LIST_FOREACH(new_vip, &vimage_head, vi_le) {
-			if (!vi_child_of(vip, new_vip))
-				continue;
-			if (strcmp(vi_req->vi_name, new_vip->vi_name) == 0) {
-				new_vnet = new_vip->v_net;
-				break;
-			}
-		}
-
-	if (new_vnet == NULL)
-		return (ENXIO);
+	} else {
+		new_vip = vimage_by_name(vip, vi_req->vi_name);
+		if (new_vip == NULL)
+			return (ENXIO);
+		new_vnet = new_vip->v_net;
+	}
 
 	if (ifp == NULL)
 		ifp = ifunit(vi_req->vi_chroot);



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