소스 검색

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 <kristian.evensen at gmail.com>

Kristian Evensen 9 년 전
부모
커밋
19c53807d9
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      scripts/netifd-proto.sh

+ 2 - 1
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() {