From: marko Date: Tue, 9 Oct 2007 11:22:51 +0000 (+0000) Subject: Eliminate the guesswork when attempting to determine the id of a X-Git-Url: https://git.entuzijast.net/?a=commitdiff_plain;h=a653740fefe24edefe7fc3aaf84b14655778c5be;p=imunes.git Eliminate the guesswork when attempting to determine the id of a newly created ng_eiface or ng_iface node. The replacement approach at "ngctl mkpeer" invocation yields deterministic results, and reduces the spawned process pipeline at the same time, thus reducing the time / CPU cycles wasted on ng node creation. Bug found by: Submitted by: Reviewed by: Approved by: Obtained from: --- diff --git a/exec.tcl b/exec.tcl index c9ce007..2f98845 100755 --- a/exec.tcl +++ b/exec.tcl @@ -1,4 +1,4 @@ -# $Id: exec.tcl,v 1.57 2007/10/08 23:28:13 marko Exp $ +# $Id: exec.tcl,v 1.58 2007/10/09 11:22:51 marko Exp $ # Copyright 2004, 2005 University of Zagreb, Croatia. All rights reserved. # @@ -228,8 +228,7 @@ proc statline {line} { # * name -- the name of the new interface #**** proc createIfc {type hook} { - catch { exec ngctl mkpeer $type $hook $hook } - catch { exec ngctl l | fgrep " Name: " | cut -c9-23 | xargs echo } nglist + catch { exec printf "mkpeer eiface ether ether \n show .ether" | ngctl -f - } nglist return [lindex $nglist 1] }