]> git.entuzijast.net Git - imunes.git/commitdiff
When instantiatinga an interface in a L3 node which is directly
authormarko <marko>
Thu, 30 Aug 2007 22:56:09 +0000 (22:56 +0000)
committermarko <marko>
Thu, 30 Aug 2007 22:56:09 +0000 (22:56 +0000)
connected to an rj45 outlet, use the MAC address of the physical
interface on the virtual interface as well.  This allows for
virtual nodes to gain access to the outside world via 802.11
physical cards.

Bug found by:
Submitted by:
Reviewed by:
Approved by:
Obtained from:

exec.tcl

index 5c8183ee6793fbac5fb81bd3b9c0b43ebbee624b..6d14b444c4ef31a93091691becea47cd2d9ebfaa 100755 (executable)
--- a/exec.tcl
+++ b/exec.tcl
@@ -1,4 +1,4 @@
-# $Id: exec.tcl,v 1.55 2007/08/21 07:54:15 marko Exp $
+# $Id: exec.tcl,v 1.56 2007/08/30 22:56:09 marko Exp $
 
 # Copyright 2004, 2005 University of Zagreb, Croatia.  All rights reserved.
 #
@@ -263,11 +263,18 @@ proc l3node.instantiate { eid node } {
            eth {
                set ifid [createIfc eiface ether]
                nexec vimage -i $node_id $ifid $ifc
-               set ether 40:00:aa:aa:$mac_byte4:$mac_byte5
-               incr mac_byte5
-               if { $mac_byte5 >= 100 } {
-                   set mac_byte5 0
-                   incr mac_byte4
+
+               set peer [peerByIfc $node $ifc]
+               if { [nodeType $peer] == "rj45" } {
+                   set peerifc [getNodeName $peer]
+                   set ether [nexec ifconfig $peerifc | fgrep "ether " | cut -c8-]
+               } else {
+                   set ether 40:00:aa:aa:$mac_byte4:$mac_byte5
+                   incr mac_byte5
+                   if { $mac_byte5 >= 100 } {
+                       set mac_byte5 0
+                       incr mac_byte4
+                   }
                }
                nexec vimage $node_id ifconfig $ifc link $ether
                set ngnodemap($ifc@$node_id) $ifid