From 2d6ea9560c7243b7ee6ab38c99aeb05ab548eacd Mon Sep 17 00:00:00 2001 From: marko Date: Thu, 30 Aug 2007 22:56:09 +0000 Subject: [PATCH] When instantiatinga an interface in a L3 node which is directly 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 | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/exec.tcl b/exec.tcl index 5c8183e..6d14b44 100755 --- 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 -- 2.39.5