]> git.entuzijast.net Git - imunes.git/commitdiff
Eliminate the guesswork when attempting to determine the id of a
authormarko <marko>
Tue, 9 Oct 2007 11:22:51 +0000 (11:22 +0000)
committermarko <marko>
Tue, 9 Oct 2007 11:22:51 +0000 (11:22 +0000)
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:

exec.tcl

index c9ce00785e3c885ceca0ad3e7e8cdaf5c46f0301..2f988451925a35092c9cb15ca2616c12c17ed47b 100755 (executable)
--- 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]
 }