From c8bd14ea81ab8a684fd63945e66582951c7ca5d4 Mon Sep 17 00:00:00 2001 From: slioch Date: Mon, 15 Dec 2008 15:53:37 -0800 Subject: 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. --- src/lbdecision.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src') 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 -- cgit v1.2.3