Commit 5bef91ea authored by Shashi Guruprasad's avatar Shashi Guruprasad

tmcc ifconfig was getting called twice, the second time due to nse code.

Eliminated the second call. The output from the first time is now used
to construct the file $BOOTDIR/tmcc.ifconfig
parent 47ddaeb0
......@@ -854,9 +854,28 @@ sub doifconfig (;$)
}
my $TM = OPENTMCC(TMCCCMD_IFC);
#
# 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 "$_";
}
}
close(IFCFG);
CLOSETMCC($TM);
#
......@@ -1926,18 +1945,6 @@ sub dotrafficconfig()
# now because of having FullTcp based traffic generation.
# Needs to move to a different place
if (!REMOTE() && !JAILED()) {
my $record_sep;
$record_sep = $/;
undef($/);
$TM = OPENTMCC(TMCCCMD_IFC);
open(IFCFG, ">$BOOTDIR/tmcc.ifconfig") or
die "Cannot open file $BOOTDIR/tmcc.ifconfig: $!";
print IFCFG <$TM>;
close(IFCFG);
CLOSETMCC($TM);
$/ = $record_sep;
open(TRAFCFG, ">$BOOTDIR/tmcc.trafgens") or
die "Cannot open file $BOOTDIR/tmcc.trafgens: $!";
}
......
......@@ -854,9 +854,28 @@ sub doifconfig (;$)
}
my $TM = OPENTMCC(TMCCCMD_IFC);
#
# 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 "$_";
}
}
close(IFCFG);
CLOSETMCC($TM);
#
......@@ -1926,18 +1945,6 @@ sub dotrafficconfig()
# now because of having FullTcp based traffic generation.
# Needs to move to a different place
if (!REMOTE() && !JAILED()) {
my $record_sep;
$record_sep = $/;
undef($/);
$TM = OPENTMCC(TMCCCMD_IFC);
open(IFCFG, ">$BOOTDIR/tmcc.ifconfig") or
die "Cannot open file $BOOTDIR/tmcc.ifconfig: $!";
print IFCFG <$TM>;
close(IFCFG);
CLOSETMCC($TM);
$/ = $record_sep;
open(TRAFCFG, ">$BOOTDIR/tmcc.trafgens") or
die "Cannot open file $BOOTDIR/tmcc.trafgens: $!";
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment