summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Larson <mike@vyatta.com>2011-09-12 14:58:32 -0700
committerMichael Larson <mike@vyatta.com>2011-09-12 14:58:32 -0700
commit1ac321d8093787035c09c0bcabaae64bef7f5d2e (patch)
tree84b62b4bfdc02e77b4aec35f341daa782b9ce3de
parent9ea51f6fd9e901f472aa445d8f8597d93b94153b (diff)
downloadvyatta-wanloadbalance-1ac321d8093787035c09c0bcabaae64bef7f5d2e.tar.gz
vyatta-wanloadbalance-1ac321d8093787035c09c0bcabaae64bef7f5d2e.zip
fix for bug 7315. Target status behavior has been modified to fix this bug:
vyatta@vyatta# run show wan-load-balance Interface: eth0 Status: active Last Status Change: Mon Sep 12 21:55:13 2011 -Test: ping Target: 8.8.8.8 +Test: ping Target: 10.3.0.120 Test: ping Target: 127.0.0.1 Last Interface Success: 0s Last Interface Failure: n/a # Interface Failure(s): 0 [edit] vyatta@vyatta# run show wan-load-balance Interface: eth0 Status: active Last Status Change: Mon Sep 12 21:55:13 2011 +Test: ping Target: 8.8.8.8 Test: ping Target: 10.3.0.120 Test: ping Target: 127.0.0.1 Last Interface Success: 0s Last Interface Failure: n/a # Interface Failure(s): 0 - denotes failed test + denotes successful test blank means the test wasn't performed All test status' refer to the last test cycle.
-rw-r--r--src/lbdata.cc6
-rw-r--r--src/lboutput.cc2
-rw-r--r--src/lbtest_icmp.cc12
-rw-r--r--src/lbtest_icmp.hh2
4 files changed, 20 insertions, 2 deletions
diff --git a/src/lbdata.cc b/src/lbdata.cc
index 39deaa6..99c36e7 100644
--- a/src/lbdata.cc
+++ b/src/lbdata.cc
@@ -66,6 +66,12 @@ LBHealth::put(int rtt)
void
LBHealth::start_new_test_cycle()
{
+ //let's first clear out all the old results
+ TestIter t = _test_coll.begin();
+ while (t != _test_coll.end()) {
+ t->second->_state = LBTest::K_NONE;
+ ++t;
+ }
_test_iter = _test_coll.begin();
// _test_iter->second->start();
}
diff --git a/src/lboutput.cc b/src/lboutput.cc
index 31829e9..28eb001 100644
--- a/src/lboutput.cc
+++ b/src/lboutput.cc
@@ -83,7 +83,7 @@ LBOutput::write(const LBData &lbdata)
string status;
if (titer->second->_state == LBTest::K_NONE) {
- status = "*";
+ status = " ";
}
else if (titer->second->_state == LBTest::K_FAILURE) {
status = "-";
diff --git a/src/lbtest_icmp.cc b/src/lbtest_icmp.cc
index d887d53..5bdc14d 100644
--- a/src/lbtest_icmp.cc
+++ b/src/lbtest_icmp.cc
@@ -173,6 +173,18 @@ LBTestICMP::send(int send_sock, const string &iface, const string &target_addr,
}
}
+/**
+ *
+ *
+ **/
+string
+LBTestICMP::status()
+{
+ //set the status line to be used when the show command is invoked
+ return name() + "\t" + string("Target: ") + _target;
+}
+
+
/**
*
diff --git a/src/lbtest_icmp.hh b/src/lbtest_icmp.hh
index d2148d6..2de9115 100644
--- a/src/lbtest_icmp.hh
+++ b/src/lbtest_icmp.hh
@@ -39,7 +39,7 @@ public:
name() {return string("ping");}
string
- status() {return _status_line;}
+ status();
private:
void