All new accounts created on Gitlab now require administrator approval. If you invite any collaborators, please let Flux staff know so they can approve the accounts.

Commit 434a472a authored by Leigh B. Stoller's avatar Leigh B. Stoller

* New libtmcc.pm module that encapsulates the tmcc interface. Most of the

  code that was in libsetup has moved into this library, and underwent a
  giant cleaning and pumping up. The interface from your typical perl
  script now looks like this:

  use libtmcc;

  if (tmcc(TMCCCMD_STATUS, "optional arguments", \@tmccresults) < 0) {
      warn("*** WARNING: Could not get status from server!\n");
      return -1;
  }
  foreach my $me (@tmccresults) {
	print "bite $me";
  }

  The arguments and results are optional values. There is a fourth optional
  value that is a hash of config options (basically converted to command
  line switches passed to tmcc). For example, to set the timeout on an
  individual call, pass a fourth argument like:

	("timeout" => 5)

  There is also a way to set global options so that all subsequent tmcc
  calls are affected:

	configtmcc("timeout", 5);

  I'll probably clean this up a bit to avoid the direct strings.

  The result list is a list of strings. Since we are trending away from
  using tmcc to transfer large amounts of data, I think this is okay.

* A new tmcc.pl which does little more than load libtmcc and use it.
  This will become the new tmcc, with the existing C version becoming a
  backend binary for it.

* All of the perl scripts in tmcd have been changed to use the new
  library. I left the few uses of tmcc in shell scripts alone since they
  were of the simple variety (mostly "state" command).

* And again, if you have read this far, you will learn why I bothered with
  all this. Well, the existing code was really bad and it was getting out
  of control. Sort of like a squid that was getting harder to control as
  its rotting tenticles slithered into more and more scripts. Anyway ...

  More important, my goal is to use the libtmcc library to add caching.  I
  have not worked out the details yet, but I am envisioning a configuration
  file, perhaps generated initially by tmcd, of all of the config
  values. If the library finds that file, it sucks the info out of the file
  instead of going to tmcd. Eventually, this config file would be generated
  as part of experiment swapping and stored in the DB, but thats a longer
  term project, and perhaps orthogonal (how we fill the cache is not as
  important as adding the ability to use a cache, right?).

  Note that certain operations (like "state" and "ready") are flagged by
  the library to always bypass the "cache".
parent fd279db8
stoller 2003/10/06 14:27:46 MDT
Modified files:
tmcd libsetup.pm
tmcd/common GNUmakefile.in bootsubnodes bootvnodes
ntpstart rc.progagent sendevent update
vnodesetup watchdog
tmcd/freebsd GNUmakefile.in delaysetup rc.delayagent
tbshutdown
tmcd/linux GNUmakefile.in delaysetup ixpboot
supfile.in
tmcd/plab GNUmakefile.in
tmcd/ron GNUmakefile.in emulabctl webserver.pl
Added files:
tmcd/common libtmcc.pm tmcc.pl
tmcd/ron makefile
Log:
* New libtmcc.pm module that encapsulates the tmcc interface. Most of the
code that was in libsetup has moved into this library, and underwent a
giant cleaning and pumping up. The interface from your typical perl
script now looks like this:
use libtmcc;
if (tmcc(TMCCCMD_STATUS, "optional arguments", \@tmccresults) < 0) {
warn("*** WARNING: Could not get status from server!\n");
return -1;
}
foreach my $me (@tmccresults) {
print "bite $me";
}
The arguments and results are optional values. There is a fourth optional
value that is a hash of config options (basically converted to command
line switches passed to tmcc). For example, to set the timeout on an
individual call, pass a fourth argument like:
("timeout" => 5)
There is also a way to set global options so that all subsequent tmcc
calls are affected:
configtmcc("timeout", 5);
I'll probably clean this up a bit to avoid the direct strings.
The result list is a list of strings. Since we are trending away from
using tmcc to transfer large amounts of data, I think this is okay.
* A new tmcc.pl which does little more than load libtmcc and use it.
This will become the new tmcc, with the existing C version becoming a
backend binary for it.
* All of the perl scripts in tmcd have been changed to use the new
library. I left the few uses of tmcc in shell scripts alone since they
were of the simple variety (mostly "state" command).
* And again, if you have read this far, you will learn why I bothered with
all this. Well, the existing code was really bad and it was getting out
of control. Sort of like a squid that was getting harder to control as
its rotting tenticles slithered into more and more scripts. Anyway ...
More important, my goal is to use the libtmcc library to add caching. I
have not worked out the details yet, but I am envisioning a configuration
file, perhaps generated initially by tmcd, of all of the config
values. If the library finds that file, it sucks the info out of the file
instead of going to tmcd. Eventually, this config file would be generated
as part of experiment swapping and stored in the DB, but thats a longer
term project, and perhaps orthogonal (how we fill the cache is not as
important as adding the ability to use a cache, right?).
Note that certain operations (like "state" and "ready") are flagged by
the library to always bypass the "cache".
Revision Changes Path
1.83 +322 -446 testbed/tmcd/libsetup.pm
1.14 +2 -0 testbed/tmcd/common/GNUmakefile.in
1.2 +14 -10 testbed/tmcd/common/bootsubnodes
1.10 +13 -9 testbed/tmcd/common/bootvnodes
1.4 +17 -13 testbed/tmcd/common/ntpstart
1.4 +2 -1 testbed/tmcd/common/rc.progagent
1.2 +4 -3 testbed/tmcd/common/sendevent
1.4 +1 -1 testbed/tmcd/common/update
1.18 +10 -7 testbed/tmcd/common/vnodesetup
1.8 +17 -11 testbed/tmcd/common/watchdog
1.40 +1 -1 testbed/tmcd/freebsd/GNUmakefile.in
1.10 +18 -13 testbed/tmcd/freebsd/delaysetup
1.7 +2 -1 testbed/tmcd/freebsd/rc.delayagent
1.3 +4 -2 testbed/tmcd/freebsd/tbshutdown
1.36 +1 -1 testbed/tmcd/linux/GNUmakefile.in
1.2 +12 -8 testbed/tmcd/linux/delaysetup
1.5 +23 -12 testbed/tmcd/linux/ixpboot
1.3 +1 -1 testbed/tmcd/linux/supfile.in
1.4 +5 -2 testbed/tmcd/plab/GNUmakefile.in
1.9 +1 -1 testbed/tmcd/ron/GNUmakefile.in
1.7 +4 -3 testbed/tmcd/ron/emulabctl
1.4 +49 -12 testbed/tmcd/ron/webserver.pl
stoller 2003/09/30 09:30:09 MDT
Modified files:
......
......@@ -64,6 +64,8 @@ path-install: dir-install
common-script-install: dir-install
$(INSTALL) -m 755 $(SRCDIR)/../libsetup.pm $(BINDIR)/libsetup.pm
$(INSTALL) -m 755 $(SRCDIR)/libtmcc.pm $(BINDIR)/libtmcc.pm
$(INSTALL) -m 755 $(SRCDIR)/tmcc.pl $(BINDIR)/tmcc
$(INSTALL) -m 755 $(SRCDIR)/watchdog $(BINDIR)/watchdog
$(INSTALL) -m 755 $(SRCDIR)/ntpstart $(BINDIR)/ntpstart
$(INSTALL) -m 755 $(SRCDIR)/runstartup $(BINDIR)/runstartup
......
......@@ -36,6 +36,7 @@ BEGIN { require "/etc/emulab/paths.pm"; import emulabpaths; }
# library and initialize itself.
#
use libsetup;
use libtmcc;
# Locals
my $logname = "$LOGDIR/bootsubnodes.debug";
......@@ -85,21 +86,24 @@ my %subnodelist;
# Get the current set of subnodes that are supposed to be running on
# this node.
#
my $TM = OPENTMCC(TMCCCMD_SUBNODELIST);
while (<$TM>) {
if ($_ =~ /^NODEID=([-\w]+) TYPE=([-\w]+)$/) {
my @tmccresults;
if (tmcc(TMCCCMD_SUBNODELIST, undef, \@tmccresults) < 0) {
die("*** WARNING: Could not get subnode list from server!\n");
}
if (! @tmccresults) {
print "No subnodes. Exiting gracefully ...\n";
exit(0);
}
foreach my $str (@tmccresults) {
if ($str =~ /^NODEID=([-\w]+) TYPE=([-\w]+)$/) {
$subnodelist{$1} = $2;
}
else {
print "Skipping bad subnodeid: '$_'\n";
warn("*** WARNING: Skipping bad subnodeid: '$str'\n");
}
}
CLOSETMCC($TM);
if (! scalar(keys(%subnodelist))) {
print "No subnodes. Exiting gracefully ...\n";
exit(0);
}
print "subnodelist is @{[keys(%subnodelist)]}\n";
# Pause to give hardware settle time.
......
......@@ -36,6 +36,7 @@ BEGIN { require "/etc/emulab/paths.pm"; import emulabpaths; }
# library and initialize itself.
#
use libsetup;
use libtmcc;
# Locals
my $logname = "$LOGDIR/bootvnodes.debug";
......@@ -132,22 +133,25 @@ my @vnodes;
# Get the current set of vnodes that are supposed to be running on
# this node.
#
my $TM = OPENTMCC(TMCCCMD_VNODELIST);
while (<$TM>) {
my @tmccresults;
if (tmcc(TMCCCMD_VNODELIST, undef, \@tmccresults) < 0) {
die("*** WARNING: Could not get vnode list from server!\n");
}
if (! @tmccresults) {
print "No vnodes. Exiting gracefully ...\n";
exit(0);
}
foreach my $str (@tmccresults) {
if ($_ =~ /^VNODEID=([-\w]+) JAILED=(\d)$/) {
$curvnodelist{$1} = $2;
}
else {
print "Skipping bad vnodeid: '$_'\n";
warn("*** WARNING: Skipping bad subnodeid: '$str'\n");
}
}
CLOSETMCC($TM);
@vnodes = keys(%curvnodelist);
if (! @vnodes) {
print "No vnodes. Exiting gracefully ...\n";
exit(0);
}
print "Vnodelist is @vnodes.\n";
#
......
......@@ -14,7 +14,7 @@ package libsetup;
use Exporter;
@ISA = "Exporter";
@EXPORT =
qw ( libsetup_init libsetup_setvnodeid cleanup_node
qw ( libsetup_init libsetup_setvnodeid libsetup_settimeout cleanup_node
doifconfig dohostnames domounts dotunnels check_nickname
doaccounts dorpms dotarballs dostartupcmd install_deltas
bootsetup nodeupdate startcmdstatus whatsmynickname dosyncserver
......@@ -23,25 +23,33 @@ use Exporter;
tmcctimeout libsetup_getvnodeid dotrafficconfig
ixpsetup dokeyhash donodeid
OPENTMCC CLOSETMCC RUNTMCC MFS REMOTE JAILED PLAB LOCALROOTFS IXP
MFS REMOTE JAILED PLAB LOCALROOTFS IXP
CONFDIR TMCC TMIFC TMDELAY TMRPM TMTARBALLS TMHOSTS TMJAILNAME
TMNICKNAME HOSTSFILE TMSTARTUPCMD FINDIF TMTUNNELCONFIG
TMTRAFFICCONFIG TMROUTECONFIG TMLINKDELAY TMDELMAP TMMOUNTDB
TMPROGAGENTS TMPASSDB TMGROUPDB TMGATEDCONFIG
TMSYNCSERVER TMRCSYNCSERVER TMKEYHASH TMNODEID
TMCCCMD_REBOOT TMCCCMD_STATUS TMCCCMD_IFC TMCCCMD_ACCT TMCCCMD_DELAY
TMCCCMD_HOSTS TMCCCMD_RPM TMCCCMD_TARBALL TMCCCMD_STARTUP
TMCCCMD_DELTA TMCCCMD_STARTSTAT TMCCCMD_READY TMCCCMD_TRAFFIC
TMCCCMD_BOSSINFO TMCCCMD_VNODELIST TMCCCMD_ISALIVE TMCCCMD_LINKDELAYS
TMCCCMD_PROGRAMS TMCCCMD_SUBNODELIST TMCCCMD_SUBCONFIG
TMCCCMD_STATE TMCCCMD_SYNCSERVER TMCCCMD_KEYHASH TMCCCMD_NODEID
);
# Must come after package declaration!
use English;
# The tmcc library.
use libtmcc;
#
# This is the VERSION. We send it through to tmcd so it knows what version
# responses this file is expecting.
#
# BE SURE TO BUMP THIS AS INCOMPATIBILE CHANGES TO TMCD ARE MADE!
#
sub TMCD_VERSION() { 12; };
libtmcc::configtmcc("version", TMCD_VERSION());
# Control tmcc timeout.
sub libsetup_settimeout($) { libtmcc::configtmcc("timeout", $_[0]); };
#
# For virtual (multiplexed nodes). If defined, tack onto tmcc command.
# and use in pathnames. Used in conjunction with jailed virtual nodes.
......@@ -50,7 +58,17 @@ use English;
my $vnodeid;
sub libsetup_setvnodeid($)
{
($vnodeid) = @_;
my ($vid) = @_;
if ($vid =~ /^([-\w]+)$/) {
$vid = $1;
}
else {
die("Bad data in vnodeid: $vid");
}
$vnodeid = $vid;
libtmcc::configtmcc("subnode", $vnodeid);
}
sub libsetup_getvnodeid()
{
......@@ -93,15 +111,10 @@ BEGIN
#
if (-e "$BOOTDIR/jailname") {
open(VN, "$BOOTDIR/jailname");
$vnodeid = <VN>;
my $vid = <VN>;
close(VN);
if ($vnodeid =~ /^([-\w]+)$/) {
$vnodeid = $1;
}
else {
die("Bad data in vnodeid: $vnodeid");
}
libsetup_setvnodeid($vid);
$injail = 1;
#
......@@ -124,15 +137,10 @@ BEGIN
# Determine if running inside a Plab vserver.
if (-e "$BOOTDIR/plabname") {
open(VN, "$BOOTDIR/plabname");
$vnodeid = <VN>;
my $vid = <VN>;
close(VN);
if ($vnodeid =~ /^([-\w]+)$/) {
$vnodeid = $1;
}
else {
die("Bad data in vnodeid: $vnodeid");
}
libsetup_setvnodeid($vid);
$inplab = 1;
}
......@@ -244,50 +252,6 @@ sub TMNODEID() { CONFDIR() . "/nodeid";}
#
my $USESFS = 1;
#
# This is the VERSION. We send it through to tmcd so it knows what version
# responses this file is expecting.
#
# BE SURE TO BUMP THIS AS INCOMPATIBILE CHANGES TO TMCD ARE MADE!
#
sub TMCD_VERSION() { 12; };
#
# These are the TMCC commands.
#
sub TMCCCMD_REBOOT() { "reboot"; }
sub TMCCCMD_STATUS() { "status"; }
sub TMCCCMD_STATE() { "state"; }
sub TMCCCMD_IFC() { "ifconfig"; }
sub TMCCCMD_ACCT() { "accounts"; }
sub TMCCCMD_DELAY() { "delay"; }
sub TMCCCMD_HOSTS() { "hostnames"; }
sub TMCCCMD_RPM() { "rpms"; }
sub TMCCCMD_TARBALL() { "tarballs"; }
sub TMCCCMD_STARTUP() { "startupcmd"; }
sub TMCCCMD_DELTA() { "deltas"; }
sub TMCCCMD_STARTSTAT() { "startstatus"; }
sub TMCCCMD_READY() { "ready"; }
sub TMCCCMD_MOUNTS() { "mounts"; }
sub TMCCCMD_ROUTING() { "routing"; }
sub TMCCCMD_TRAFFIC() { "trafgens"; }
sub TMCCCMD_BOSSINFO() { "bossinfo"; }
sub TMCCCMD_TUNNEL() { "tunnels"; }
sub TMCCCMD_NSECONFIGS(){ "nseconfigs"; }
sub TMCCCMD_VNODELIST() { "vnodelist"; }
sub TMCCCMD_SUBNODELIST(){ "subnodelist"; }
sub TMCCCMD_ISALIVE() { "isalive"; }
sub TMCCCMD_SFSHOSTID() { "sfshostid"; }
sub TMCCCMD_SFSMOUNTS() { "sfsmounts"; }
sub TMCCCMD_JAILCONFIG(){ "jailconfig"; }
sub TMCCCMD_PLABCONFIG(){ "plabconfig"; }
sub TMCCCMD_SUBCONFIG() { "subconfig"; }
sub TMCCCMD_LINKDELAYS(){ "linkdelays"; }
sub TMCCCMD_PROGRAMS() { "programs"; }
sub TMCCCMD_SYNCSERVER(){ "syncserver"; }
sub TMCCCMD_KEYHASH() { "keyhash"; }
sub TMCCCMD_NODEID() { "nodeid"; }
#
# Some things never change.
#
......@@ -313,10 +277,6 @@ my $pid = "";
my $eid = "";
my $vname = "";
# Control tmcc error condition and timeout. Dynamic, not lexical!
$tmcctimeout = 0;
my $TMCCTIMEO = 30; # Default timeout on remote nodes.
# When on the MFS, we do a much smaller set of stuff.
# Cause of the way the packages are loaded (which I do not understand),
# this is computed on the fly instead of once.
......@@ -355,87 +315,6 @@ if (!MFS()) {
import Socket;
}
#
# Open a TMCC connection and return the "stream pointer". Caller is
# responsible for closing the stream and checking return value.
#
# usage: OPENTMCC(char *command, char *args, char *options)
#
sub OPENTMCC($;$$)
{
my($cmd, $args, $options) = @_;
my $vn = "";
local *TM;
if (!defined($args)) {
$args = "";
}
if (!defined($options)) {
$options = "";
}
if (defined($vnodeid)) {
$vn = "-n $vnodeid";
}
if ($tmcctimeout) {
$options .= " -t $tmcctimeout";
}
if (defined($tmccproxy)) {
$options .= " -l $tmccproxy";
}
my $foo = sprintf("%s -v %d $options $NODE $vn $cmd $args |",
TMCC, TMCD_VERSION);
if (!open(TM, $foo)) {
print STDERR "Cannot start TMCC: $!\n";
return undef;
}
return (*TM);
}
#
# Close connection. Die on error.
#
sub CLOSETMCC($) {
my($TM) = @_;
if (! close($TM)) {
if ($?) {
print STDERR "TMCC exited with status $?!\n";
}
else {
print STDERR "Error closing TMCC pipe: $!\n";
}
return 0;
}
return 1;
}
#
# Run a TMCC command with the provided arguments.
#
# usage: RUNTMCC(char *command, char *args, char *options)
#
sub RUNTMCC($;$$)
{
my($cmd, $args, $options) = @_;
my($TM);
if (!defined($args)) {
$args = "";
}
if (!defined($options)) {
$options = "";
}
$TM = OPENTMCC($cmd, $args, $options);
close($TM)
or die $? ? "TMCC exited with status $?" : "Error closing pipe: $!";
return 0;
}
#
# Reset to a moderately clean state.
#
......@@ -479,23 +358,28 @@ sub cleanup_node ($) {
#
sub check_status ()
{
my $TM = OPENTMCC(TMCCCMD_STATUS);
$_ = <$TM>;
CLOSETMCC($TM);
my $status;
my @tmccresults;
if ($_ =~ /^FREE/) {
if (tmcc(TMCCCMD_STATUS, undef, \@tmccresults) < 0) {
warn("*** WARNING: Could not get status from server!\n");
return -1;
}
$status = $tmccresults[0];
if ($status =~ /^FREE/) {
unlink TMNICKNAME;
return 0;
}
if ($_ =~ /ALLOCATED=([-\@\w]*)\/([-\@\w]*) NICKNAME=([-\@\w]*)/) {
if ($status =~ /ALLOCATED=([-\@\w]*)\/([-\@\w]*) NICKNAME=([-\@\w]*)/) {
$pid = $1;
$eid = $2;
$vname = $3;
}
else {
warn "*** WARNING: Error getting reservation status\n";
return 0;
return -1;
}
#
......@@ -539,12 +423,12 @@ sub check_nickname()
#
sub domounts()
{
my $TM;
my %MDB;
my %mounts;
my %deletes;
my %sfsmounts;
my %sfsdeletes;
my @tmccresults;
#
# Update our SFS hostid first. If this fails, dosfshostid will
......@@ -564,20 +448,22 @@ sub domounts()
}
}
$TM = OPENTMCC(TMCCCMD_MOUNTS, "USESFS=$USESFS");
if (tmcc(TMCCCMD_MOUNTS, "USESFS=$USESFS", \@tmccresults) < 0) {
warn("*** WARNING: Could not get mount list from server!\n");
return -1;
}
while (<$TM>) {
if ($_ =~ /^REMOTE=([-:\@\w\.\/]+) LOCAL=([-\@\w\.\/]+)/) {
foreach my $str (@tmccresults) {
if ($str =~ /^REMOTE=([-:\@\w\.\/]+) LOCAL=([-\@\w\.\/]+)/) {
$mounts{$1} = $2;
}
elsif ($_ =~ /^SFS REMOTE=([-:\@\w\.\/]+) LOCAL=([-\@\w\.\/]+)/) {
elsif ($str =~ /^SFS REMOTE=([-:\@\w\.\/]+) LOCAL=([-\@\w\.\/]+)/) {
$sfsmounts{$1} = $2;
}
else {
warn "*** WARNING: Malformed mount information: $_\n";
warn "*** WARNING: Malformed mount information: $str\n";
}
}
CLOSETMCC($TM);
#
# The MFS version does not support (or need) this DB stuff. Just mount
......@@ -780,7 +666,8 @@ sub JailedMounts($$$)
if ($usenfs) {
$mountstr = $NFSMOUNT;
} else {
}
else {
$mountstr = $LOOPBACKMOUNT;
}
......@@ -821,7 +708,6 @@ sub JailedMounts($$$)
#
sub dosfshostid ()
{
my $TM;
my $myhostid;
# Do I already have a host key?
......@@ -842,12 +728,12 @@ sub dosfshostid ()
if ( $myhostid =~ /^([-\.\w_]*:[a-z0-9]*)$/ ) {
$myhostid = $1;
print STDOUT " Hostid: $myhostid\n";
RUNTMCC(TMCCCMD_SFSHOSTID, "$myhostid");
tmcc(TMCCCMD_SFSHOSTID, "$myhostid");
}
elsif ( $myhostid =~ /^(@[-\.\w_]*,[a-z0-9]*)$/ ) {
$myhostid = $1;
print STDOUT " Hostid: $myhostid\n";
RUNTMCC(TMCCCMD_SFSHOSTID, "$myhostid");
tmcc(TMCCCMD_SFSHOSTID, "$myhostid");
}
else {
warn "*** WARNING: Invalid hostid\n";
......@@ -867,57 +753,42 @@ sub dosfshostid ()
#
sub doifconfig (;$)
{
my ($rtabid) = @_;
my @ifaces = ();
my $upcmds = "";
my $downcmds = "";
my @ifacelist= ();
my ($rtabid) = @_;
my @tmccresults = ();
my $upcmds = "";
my $downcmds = "";
my @ifacelist = (); # IXP siilly
my $xifslist = (); # NSE/Gated sillyness?
#
# Kinda ugly, but there is too much perl goo included by Socket to put it
# on the MFS.
#
if (MFS()) {
return 1;
return 0;
}
my $TM = OPENTMCC(TMCCCMD_IFC);
if (tmcc(TMCCCMD_IFC, undef, \@tmccresults) < 0) {
warn("*** WARNING: Could not get interface config from server!\n");
return -1;
}
#
# XXX hack: workaround for tmcc cmd failure inside TCL
# storing the output of a few tmcc commands in
# $BOOTDIR files for use by NSE
if (!REMOTE() && !JAILED()) {
open(IFCFG, ">$BOOTDIR/tmcc.ifconfig") or
die "Cannot open file $BOOTDIR/tmcc.ifconfig: $!";
}
while (<$TM>) {
push(@ifaces, $_);
#
# XXX hack: workaround for tmcc cmd failure inside TCL
# storing the output of a few tmcc commands in
# $BOOTDIR files for use by NSE
if (!REMOTE() && !JAILED()) {
print IFCFG "$_";
if (open(IFCFG, ">$BOOTDIR/tmcc.ifconfig")) {
foreach my $str (@tmccresults) {
print IFCFG "$str";
}
close(IFCFG);
}
}
close(IFCFG);
CLOSETMCC($TM);
#
# Create the interface list file.
# Control net is always first.
#
open(XIFS, ">$BOOTDIR/tmcc.ifs") or
die "Cannot open file $BOOTDIR/tmcc.ifs: $!";
print XIFS `control_interface`;
if (! @ifaces) {
close(XIFS);
return 0;
else {
warn("*** WARNING: ".
"Cannot open file $BOOTDIR/tmcc.ifconfig: $!\n");
}
# More NSE goop below.
}
my $ethpat = q(IFACETYPE=(\w*) INET=([0-9.]*) MASK=([0-9.]*) MAC=(\w*) );
......@@ -926,7 +797,7 @@ sub doifconfig (;$)
my $vethpat = q(IFACETYPE=(\w*) INET=([0-9.]*) MASK=([0-9.]*) ID=(\d*) );
$vethpat .= q(VMAC=(\w*) PMAC=(\w*));
foreach my $iface (@ifaces) {
foreach my $iface (@tmccresults) {
if ($iface =~ /$ethpat/) {
my $inet = $2;
my $mask = $3;
......@@ -941,7 +812,7 @@ sub doifconfig (;$)
if (JAILED()) {
next;
}
print XIFS "$iface\n";