summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Larson <slioch@slioch.vyatta.com>2010-06-21 09:31:48 -0700
committerMichael Larson <slioch@slioch.vyatta.com>2010-06-21 09:31:48 -0700
commitb964b6084486e8c900958fd3cbec252b7936a16d (patch)
treef75d3083a3372dcd396b29087126f73d349acf82
parent4ce7231c10064ef08765a1f335562af42545e842 (diff)
downloadvyatta-wanloadbalance-b964b6084486e8c900958fd3cbec252b7936a16d.tar.gz
vyatta-wanloadbalance-b964b6084486e8c900958fd3cbec252b7936a16d.zip
added syslog messages on failure to insert default route into policy
table.
-rw-r--r--src/lbdecision.cc12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/lbdecision.cc b/src/lbdecision.cc
index 22d56a9..ed68ddd 100644
--- a/src/lbdecision.cc
+++ b/src/lbdecision.cc
@@ -213,7 +213,7 @@ LBDecision::update_paths(LBData &lbdata)
if (new_addr != iter->second._address) {
int err = 0;
if (iter->second._address.empty() == false) {
- int err = execute(string("iptables -t nat -D WANLOADBALANCE -m connmark --mark ") + buf + " -j SNAT --to-source " + iter->second._address, stdout);
+ err = execute(string("iptables -t nat -D WANLOADBALANCE -m connmark --mark ") + buf + " -j SNAT --to-source " + iter->second._address, stdout);
}
if (new_addr.empty() == false) {
err |= execute(string("iptables -t nat -A WANLOADBALANCE -m connmark --mark ") + buf + " -j SNAT --to-source " + new_addr, stdout);
@@ -706,11 +706,17 @@ LBDecision::insert_default(LBHealth &h, string &nexthop)
if (stdout.empty() == false) {
//compare string:
if (stdout.find(nexthop) == string::npos || stdout.find(h._interface) == string::npos) { //compare expected string
- execute(default_route,stdout); //apply entry because this doesn't match
+ int err = execute(default_route,stdout); //apply entry because this doesn't match
+ if (err != 0) {
+ syslog(LOG_WARNING, string("failure to insert default route on active path with this command: " + default_route + ", resp: " + stdout).c_str());
+ }
}
}
else {
- execute(default_route,stdout); //apply entry because this doesn't match
+ int err = execute(default_route,stdout); //apply entry because this doesn't match
+ if (err != 0) {
+ syslog(LOG_WARNING, string("failure to insert default route on active path with this command: " + default_route + ", resp: " + stdout).c_str());
+ }
}
}