Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 8 Feb 2016 17:47:36 +0000 (UTC)
From:      Devin Teske <dteske@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r295401 - head/share/examples/jails
Message-ID:  <201602081747.u18HlaI6073797@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dteske
Date: Mon Feb  8 17:47:36 2016
New Revision: 295401
URL: https://svnweb.freebsd.org/changeset/base/295401

Log:
  Adjust MAC allocation algo to support layering

Modified:
  head/share/examples/jails/jib
  head/share/examples/jails/jng

Modified: head/share/examples/jails/jib
==============================================================================
--- head/share/examples/jails/jib	Mon Feb  8 17:36:46 2016	(r295400)
+++ head/share/examples/jails/jib	Mon Feb  8 17:47:36 2016	(r295401)
@@ -267,8 +267,15 @@ jib_addm()
 		10) quad=a ;; 11) quad=b ;; 12) quad=c ;;
 		13) quad=d ;; 14) quad=e ;; 15) quad=f ;;
 		esac
-		eiface_devid_a=2:$quad$eiface_devid_a
-		eiface_devid_b=6:$quad$eiface_devid_b
+		case "$iface_devid" in
+		?2:*|?6:*)
+			eiface_devid_a=a:$quad$eiface_devid_a
+			eiface_devid_b=e:$quad$eiface_devid_b
+			;;
+		*)
+			eiface_devid_a=2:$quad$eiface_devid_a
+			eiface_devid_b=6:$quad$eiface_devid_b
+		esac
 		num=$(( $num >> 4 ))
 		quad=$(( $num & 15 ))
 		case "$quad" in

Modified: head/share/examples/jails/jng
==============================================================================
--- head/share/examples/jails/jng	Mon Feb  8 17:36:46 2016	(r295400)
+++ head/share/examples/jails/jng	Mon Feb  8 17:47:36 2016	(r295401)
@@ -297,7 +297,10 @@ jng_bridge()
 		10) quad=a ;; 11) quad=b ;; 12) quad=c ;;
 		13) quad=d ;; 14) quad=e ;; 15) quad=f ;;
 		esac
-		eiface_devid=2:$quad$eiface_devid
+		case "$iface_devid" in
+		?2:*) eiface_devid=a:$quad$eiface_devid ;;
+		*) eiface_devid=2:$quad$eiface_devid
+		esac
 		num=$(( $num >> 4 ))
 		quad=$(( $num & 15 ))
 		case "$quad" in



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