diff options
author | slioch <slioch@eng-140.vyatta.com> | 2008-12-15 15:53:37 -0800 |
---|---|---|
committer | slioch <slioch@eng-140.vyatta.com> | 2008-12-15 15:53:37 -0800 |
commit | c8bd14ea81ab8a684fd63945e66582951c7ca5d4 (patch) | |
tree | 90a3ad06ec257fb938717199a020aba18462073c | |
parent | a0355005f78f34d3ecc9b88765890e8784068d32 (diff) | |
download | vyatta-wanloadbalance-c8bd14ea81ab8a684fd63945e66582951c7ca5d4.tar.gz vyatta-wanloadbalance-c8bd14ea81ab8a684fd63945e66582951c7ca5d4.zip |
fixed bug with dhcp support--route was not be reinserted on link down when configured for dhcp. need to retrieve actual nexthop in this case.
-rw-r--r-- | src/lbdecision.cc | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/lbdecision.cc b/src/lbdecision.cc index 10a730b..6c22943 100644 --- a/src/lbdecision.cc +++ b/src/lbdecision.cc @@ -223,7 +223,13 @@ LBDecision::run(LBData &lb_data) if (h_iter->second._is_active == true) { char buf[40]; sprintf(buf,"%d",h_iter->second._interface_index); - insert_default(string("ip route replace table ") + buf + " default dev " + h_iter->first + " via " + h_iter->second._nexthop, h_iter->second._interface_index); + if (h_iter->second._nexthop == "dhcp") { + string nexthop = fetch_iface_nexthop(h_iter->first); + insert_default(string("ip route replace table ") + buf + " default dev " + h_iter->first + " via " + nexthop, h_iter->second._interface_index); + } + else { + insert_default(string("ip route replace table ") + buf + " default dev " + h_iter->first + " via " + h_iter->second._nexthop, h_iter->second._interface_index); + } } else { //right now replace route, but don't delete until race condition is resolved |