[OpenWrt-Devel] netifd: Set source IP for DHCP static routes as well
diff mbox

Message ID 1418312881-23018-1-git-send-email-dedeckeh@gmail.com
State Accepted
Headers show

Commit Message

Hans Dedecker Dec. 11, 2014, 3:48 p.m. UTC
Commit ce92f6650bd8a86db04c7a6cbb58e7fdb200a7e6 added source IP support
for DHCP default routes. As a side effect of this change the default route
could be present twice in netifd (once with source IP set and once with
source IP unset) if it was sent by the server in both the router and static
route options. Therefore add source IP support as well for static routes as this
case was not considered. Additional remove unused parameter type.

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
---
 package/network/config/netifd/files/lib/netifd/dhcp.script | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Patch
diff mbox

diff --git a/package/network/config/netifd/files/lib/netifd/dhcp.script b/package/network/config/netifd/files/lib/netifd/dhcp.script
index 17e22af..54d3aa1 100755
--- a/package/network/config/netifd/files/lib/netifd/dhcp.script
+++ b/package/network/config/netifd/files/lib/netifd/dhcp.script
@@ -6,9 +6,8 @@ 
 
 set_classless_routes() {
 	local max=128
-	local type
 	while [ -n "$1" -a -n "$2" -a $max -gt 0 ]; do
-		proto_add_ipv4_route "${1%%/*}" "${1##*/}" "$2"
+		proto_add_ipv4_route "${1%%/*}" "${1##*/}" "$2" "$ip"
 		max=$(($max-1))
 		shift 2
 	done