From 1ac321d8093787035c09c0bcabaae64bef7f5d2e Mon Sep 17 00:00:00 2001 From: Michael Larson Date: Mon, 12 Sep 2011 14:58:32 -0700 Subject: 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. --- src/lbdata.cc | 6 ++++++ src/lboutput.cc | 2 +- src/lbtest_icmp.cc | 12 ++++++++++++ src/lbtest_icmp.hh | 2 +- 4 files changed, 20 insertions(+), 2 deletions(-) (limited to 'src') 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 -- cgit v1.2.3