summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lbdecision.cc8
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