PERFORCE change 126248 for review

Marko Zec zec at FreeBSD.org
Sun Sep 9 17:28:07 PDT 2007


http://perforce.freebsd.org/chv.cgi?CH=126248

Change 126248 by zec at zec_tpx32 on 2007/09/10 00:28:01

	When a vlan ifnet is assigned to a remote vnet, do not
	allow vlandev/vlantag to be either read or updated.  In
	effect this makes a vlan ifnet assigned to a remote vnet
	(at least visually) indistinguishable from plain ethernet
	ifnets.

Affected files ...

.. //depot/projects/vimage/src/sys/net/if_vlan.c#5 edit

Differences ...

==== //depot/projects/vimage/src/sys/net/if_vlan.c#5 (text+ko) ====

@@ -1379,6 +1379,12 @@
 		error = copyin(ifr->ifr_data, &vlr, sizeof(vlr));
 		if (error)
 			break;
+#ifdef VIMAGE
+		if (ifp->if_home_vnet != ifp->if_vnet) {
+			error = EPERM;
+			break;
+		}
+#endif
 		if (vlr.vlr_parent[0] == '\0') {
 			vlan_unconfig(ifp);
 			break;
@@ -1406,6 +1412,12 @@
 
 	case SIOCGETVLAN:
 		bzero(&vlr, sizeof(vlr));
+#ifdef VIMAGE
+		if (ifp->if_home_vnet != ifp->if_vnet) {
+			error = EPERM;
+			break;
+		}
+#endif
 		VLAN_LOCK();
 		if (TRUNK(ifv) != NULL) {
 			strlcpy(vlr.vlr_parent, PARENT(ifv)->if_xname,


More information about the p4-projects mailing list