From 19c53807d9dc62782d03c5564630ed1bcb953cd8 Mon Sep 17 00:00:00 2001 From: Kristian Evensen Date: Mon, 8 Dec 2014 18:42:21 +0100 Subject: [PATCH] Enable callers to pass the source IP of an IPv4 route when using proto_add_ipv4_route(). This is useful with for example DHCP in a multihomed scenario, as it provides an easy way to match default routes with the correct IP address. One use case for this are applications that monitor the state of the WAN port, and the WAN port is assigned multiple addresses. Signed-off-by: Kristian Evensen --- scripts/netifd-proto.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/netifd-proto.sh b/scripts/netifd-proto.sh index ce316c4..b5ef3d1 100644 --- a/scripts/netifd-proto.sh +++ b/scripts/netifd-proto.sh @@ -120,8 +120,9 @@ proto_add_ipv4_route() { local target="$1" local mask="$2" local gw="$3" + local source="$4" - append PROTO_ROUTE "$target/$mask/$gw//" + append PROTO_ROUTE "$target/$mask/$gw///$source" } proto_add_ipv6_route() { -- 2.25.1