summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lbdecision.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/lbdecision.cc b/src/lbdecision.cc
index 315516c..977d09a 100644
--- a/src/lbdecision.cc
+++ b/src/lbdecision.cc
@@ -416,13 +416,14 @@ LBDecision::get_application_cmd(LBRule &rule)
}
if (rule._d_addr.empty() == false) {
+ string negation;
string tmp(rule._d_addr);
if (tmp.find("!") != string::npos) {
- tmp = "! " + tmp.substr(1,tmp.length()-1);
+ negation = "! ";
}
if (tmp.find("-") != string::npos) {
- filter += "-m iprange --dst-range " + tmp + " ";
+ filter += "-m iprange " + negation + "--dst-range " + tmp + " ";
}
else {
filter += "--destination " + tmp + " ";