summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael Larson <slioch@slioch.vyatta.com>2010-03-09 13:05:40 -0800
committerMichael Larson <slioch@slioch.vyatta.com>2010-03-09 13:05:40 -0800
commit7303f19ef63e47732346ed469c6013cbc17e1977 (patch)
treeb03cc70bc084d44fd3887b006c80acae3fb7f60f /src
parent1953214d043da63b41f8a71290b4145179cf6167 (diff)
downloadvyatta-wanloadbalance-7303f19ef63e47732346ed469c6013cbc17e1977.tar.gz
vyatta-wanloadbalance-7303f19ef63e47732346ed469c6013cbc17e1977.zip
bugfix for 5427. remove outbound interface exclusion on OUTPUT table (i.e. local) traffic when exclude rule is specified.
Diffstat (limited to 'src')
-rw-r--r--src/lbdecision.cc8
-rw-r--r--src/lbdecision.hh2
2 files changed, 6 insertions, 4 deletions
diff --git a/src/lbdecision.cc b/src/lbdecision.cc
index 52d1e03..a5cc7e2 100644
--- a/src/lbdecision.cc
+++ b/src/lbdecision.cc
@@ -298,7 +298,7 @@ LBDecision::run(LBData &lb_data)
while (iter != lb_data._lb_rule_coll.end()) {
//NEED TO HANDLE APPLICATION SPECIFIC DETAILS
string app_cmd = get_application_cmd(iter->second);
- string app_cmd_local = get_application_cmd(iter->second,true);
+ string app_cmd_local = get_application_cmd(iter->second,true,iter->second._exclude);
if (iter->second._exclude == true) {
execute(string("iptables -t mangle -A WANLOADBALANCE_PRE ") + app_cmd + " -j ACCEPT", stdout);
@@ -586,13 +586,15 @@ LBDecision::get_new_weights(LBData &data, LBRule &rule)
*
**/
string
-LBDecision::get_application_cmd(LBRule &rule, bool local)
+LBDecision::get_application_cmd(LBRule &rule, bool local, bool exclude)
{
string filter;
if (rule._in_iface.empty() == false) {
if (local == true) {
- filter += " ! -o " + rule._in_iface + " ";
+ if (exclude == false) {
+ filter += " ! -o " + rule._in_iface + " ";
+ }
}
else {
filter += "-i " + rule._in_iface + " ";
diff --git a/src/lbdecision.hh b/src/lbdecision.hh
index d8c9ecf..7ef9308 100644
--- a/src/lbdecision.hh
+++ b/src/lbdecision.hh
@@ -43,7 +43,7 @@ private:
get_new_weights(LBData &data, LBRule &rule);
string
- get_application_cmd(LBRule &rule, bool local = false);
+ get_application_cmd(LBRule &rule, bool local = false, bool exclude = false);
string
fetch_iface_addr(const string &iface);