diff options
| author | slioch <slioch@eng-140.vyatta.com> | 2009-07-15 15:33:11 -0700 |
|---|---|---|
| committer | slioch <slioch@eng-140.vyatta.com> | 2009-07-15 15:33:11 -0700 |
| commit | ffe8546edce4f68121178657d4d17426eb0c7129 (patch) | |
| tree | 97ec4a9112ef70d891efce469f7dd7afc956b973 /src | |
| parent | f229c236ef9e8a8cb748e343bc01ef96ed27a403 (diff) | |
| download | vyatta-wanloadbalance-ffe8546edce4f68121178657d4d17426eb0c7129.tar.gz vyatta-wanloadbalance-ffe8546edce4f68121178657d4d17426eb0c7129.zip | |
fix for bug 4730
Diffstat (limited to 'src')
| -rw-r--r-- | src/lbdecision.cc | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/src/lbdecision.cc b/src/lbdecision.cc index 6787f41..6e0a6d1 100644 --- a/src/lbdecision.cc +++ b/src/lbdecision.cc @@ -188,26 +188,26 @@ void LBDecision::update_paths(LBData &lbdata) { string stdout; - if (lbdata._disable_source_nat == false) { - //first let's remove the entry - LBData::InterfaceHealthIter iter = lbdata._iface_health_coll.begin(); - while (iter != lbdata._iface_health_coll.end()) { - if (iter->second._is_active == true) { - string iface = iter->first; - string new_addr = fetch_iface_addr(iface); - char buf[20]; - sprintf(buf,"%d",iter->second._interface_index); - - //now let's update the nexthop here in the route table - if (iter->second._nexthop == "dhcp") { - if (iter->second._dhcp_nexthop.empty() == false) { - insert_default(string("ip route replace table ") + buf + " default dev " + iface + " via " + iter->second._dhcp_nexthop, iter->second._interface_index); - } - } - else { - insert_default(string("ip route replace table ") + buf + " default dev " + iface + " via " + iter->second._nexthop, iter->second._interface_index); + //first let's remove the entry + LBData::InterfaceHealthIter iter = lbdata._iface_health_coll.begin(); + while (iter != lbdata._iface_health_coll.end()) { + if (iter->second._is_active == true) { + string iface = iter->first; + string new_addr = fetch_iface_addr(iface); + char buf[20]; + sprintf(buf,"%d",iter->second._interface_index); + + //now let's update the nexthop here in the route table + if (iter->second._nexthop == "dhcp") { + if (iter->second._dhcp_nexthop.empty() == false) { + insert_default(string("ip route replace table ") + buf + " default dev " + iface + " via " + iter->second._dhcp_nexthop, iter->second._interface_index); } - + } + else { + insert_default(string("ip route replace table ") + buf + " default dev " + iface + " via " + iter->second._nexthop, iter->second._interface_index); + } + + if (lbdata._disable_source_nat == false) { if (new_addr != iter->second._address) { 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 -A WANLOADBALANCE -m connmark --mark ") + buf + " -j SNAT --to-source " + new_addr, stdout); @@ -216,8 +216,8 @@ LBDecision::update_paths(LBData &lbdata) } } } - ++iter; } + ++iter; } } |
