6in4: add 'nohostroute' option
authorAleksandr V. Piskunov <aleksandr.v.piskunov@gmail.com>
Tue, 16 Jul 2024 13:58:11 +0000 (16:58 +0300)
committerHauke Mehrtens <hauke@hauke-m.de>
Sun, 22 Sep 2024 14:28:52 +0000 (16:28 +0200)
Same as 'nohostroute' option for GRE tunnels (commit 0f8b9addfc)
and IPIP tunnels (commit 46ce629fe0)

Signed-off-by: Aleksandr V. Piskunov <aleksandr.v.piskunov@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/15961
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
package/network/ipv6/6in4/Makefile
package/network/ipv6/6in4/files/6in4.sh

index 3c7dd4609b3123654e3fa92f7b6e31790aa0aafa..b70da23e82a9058ce5372558ba1247da248a7584 100644 (file)
@@ -8,7 +8,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=6in4
-PKG_RELEASE:=28
+PKG_RELEASE:=29
 PKG_LICENSE:=GPL-2.0
 
 include $(INCLUDE_DIR)/package.mk
index e500c6dec8e4b11af99429e1e5e35fde7c608114..dd055ecb63fd5c2ad9366359c9872ac40a5cf9fb 100755 (executable)
@@ -46,8 +46,8 @@ proto_6in4_setup() {
        local link="6in4-$cfg"
        local remoteip
 
-       local mtu ttl tos ipaddr peeraddr ip6addr ip6prefix ip6prefixes tunlink tunnelid username password updatekey device
-       json_get_vars mtu ttl tos ipaddr peeraddr ip6addr tunlink tunnelid username password updatekey device
+       local mtu ttl tos ipaddr peeraddr ip6addr ip6prefix ip6prefixes tunlink tunnelid username password updatekey device nohostroute
+       json_get_vars mtu ttl tos ipaddr peeraddr ip6addr tunlink tunnelid username password updatekey device nohostroute
        json_for_each_item proto_6in4_add_prefix ip6prefix ip6prefixes
 
        [ -n "$device" ] && link="$device"
@@ -70,7 +70,9 @@ proto_6in4_setup() {
                break
        done
 
-       ( proto_add_host_dependency "$cfg" "$peeraddr" "$tunlink" )
+       if [ "${nohostroute}" != "1" ]; then
+               ( proto_add_host_dependency "$cfg" "$peeraddr" "$tunlink" )
+       fi
 
        [ -z "$ipaddr" ] && {
                local wanif="$tunlink"
@@ -172,6 +174,7 @@ proto_6in4_init_config() {
        proto_config_add_int "ttl"
        proto_config_add_string "tos"
        proto_config_add_string "device"
+       proto_config_add_boolean "nohostroute"
 }
 
 [ -n "$INCLUDE_ONLY" ] || {