diff options
author | Mike Larson <mike@suva.vyatta.com> | 2008-08-26 21:00:26 -0700 |
---|---|---|
committer | Mike Larson <mike@suva.vyatta.com> | 2008-08-26 21:00:26 -0700 |
commit | bee9cfb28e0578a564628d61862764b3cdb2b377 (patch) | |
tree | 9ab65b2c536df58cc4c320b94e7708c252d562f6 | |
parent | 34ed187dafc9cd9fbda7b7eefc111bb58159c47b (diff) | |
download | vyatta-wanloadbalance-bee9cfb28e0578a564628d61862764b3cdb2b377.tar.gz vyatta-wanloadbalance-bee9cfb28e0578a564628d61862764b3cdb2b377.zip |
revised fix for dst-range bug to mirror fix for src.
-rw-r--r-- | src/lbdecision.cc | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/src/lbdecision.cc b/src/lbdecision.cc index 977d09a..751659d 100644 --- a/src/lbdecision.cc +++ b/src/lbdecision.cc @@ -416,17 +416,28 @@ LBDecision::get_application_cmd(LBRule &rule) } if (rule._d_addr.empty() == false) { - string negation; + bool negate_flag = false; string tmp(rule._d_addr); if (tmp.find("!") != string::npos) { - negation = "! "; + negate_flag = true; + tmp = tmp.substr(1,tmp.length()-1); } if (tmp.find("-") != string::npos) { - filter += "-m iprange " + negation + "--dst-range " + tmp + " "; + if (negate_flag) { + filter += "-m iprange ! --dst-range " + tmp + " "; + } + else { + filter += "-m iprange --dst-range " + tmp + " "; + } } else { - filter += "--destination " + tmp + " "; + if (negate_flag) { + filter += "--destination ! " + tmp + " "; + } + else { + filter += "--destination " + tmp + " "; + } } } |