[openwrt/openwrt] comgt: directip: add sourcefilter option support

LEDE Commits lede-commits at lists.infradead.org
Sun Sep 22 14:45:57 PDT 2024


hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/8a5db2ff3c370f1ba3809e87767fbc478765abe6

commit 8a5db2ff3c370f1ba3809e87767fbc478765abe6
Author: Chen Minqiang <ptpt52 at gmail.com>
AuthorDate: Wed May 15 22:51:55 2024 +0800

    comgt: directip: add sourcefilter option support
    
    This make source based IPv6 routing option available for directip
    
    Signed-off-by: Chen Minqiang <ptpt52 at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/15508
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 package/network/utils/comgt/files/directip.sh | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/package/network/utils/comgt/files/directip.sh b/package/network/utils/comgt/files/directip.sh
index 3452fa5db7..c3b9abcad6 100644
--- a/package/network/utils/comgt/files/directip.sh
+++ b/package/network/utils/comgt/files/directip.sh
@@ -15,6 +15,7 @@ proto_directip_init_config() {
 	proto_config_add_string "auth"
 	proto_config_add_string "username"
 	proto_config_add_string "password"
+	proto_config_add_boolean sourcefilter
 	proto_config_add_defaults
 }
 
@@ -22,8 +23,8 @@ proto_directip_setup() {
 	local interface="$1"
 	local chat devpath devname
 
-	local device apn pincode ifname auth username password $PROTO_DEFAULT_OPTIONS
-	json_get_vars device apn pincode auth username password $PROTO_DEFAULT_OPTIONS
+	local device apn pincode ifname auth username password sourcefilter $PROTO_DEFAULT_OPTIONS
+	json_get_vars device apn pincode auth username password sourcefilter $PROTO_DEFAULT_OPTIONS
 
 	[ -n "$ctl_device" ] && device=$ctl_device
 
@@ -89,6 +90,7 @@ proto_directip_setup() {
 	json_add_string ifname "@$interface"
 	json_add_string proto "dhcpv6"
 	json_add_string extendprefix 1
+	[ "$sourcefilter" = "0" ] && json_add_boolean sourcefilter "0"
 	proto_add_dynamic_defaults
 	ubus call network add_dynamic "$(json_dump)"
 




More information about the lede-commits mailing list