6in4: add 'nohostroute' option

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>
This commit is contained in:
Aleksandr V. Piskunov 2024-07-16 16:58:11 +03:00 committed by Hauke Mehrtens
parent 6b5aea7429
commit a47bf906cd
2 changed files with 7 additions and 4 deletions

View File

@ -8,7 +8,7 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=6in4 PKG_NAME:=6in4
PKG_RELEASE:=28 PKG_RELEASE:=29
PKG_LICENSE:=GPL-2.0 PKG_LICENSE:=GPL-2.0
include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/package.mk

View File

@ -46,8 +46,8 @@ proto_6in4_setup() {
local link="6in4-$cfg" local link="6in4-$cfg"
local remoteip local remoteip
local mtu ttl tos ipaddr peeraddr ip6addr ip6prefix ip6prefixes 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 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 json_for_each_item proto_6in4_add_prefix ip6prefix ip6prefixes
[ -n "$device" ] && link="$device" [ -n "$device" ] && link="$device"
@ -70,7 +70,9 @@ proto_6in4_setup() {
break break
done done
if [ "${nohostroute}" != "1" ]; then
( proto_add_host_dependency "$cfg" "$peeraddr" "$tunlink" ) ( proto_add_host_dependency "$cfg" "$peeraddr" "$tunlink" )
fi
[ -z "$ipaddr" ] && { [ -z "$ipaddr" ] && {
local wanif="$tunlink" local wanif="$tunlink"
@ -172,6 +174,7 @@ proto_6in4_init_config() {
proto_config_add_int "ttl" proto_config_add_int "ttl"
proto_config_add_string "tos" proto_config_add_string "tos"
proto_config_add_string "device" proto_config_add_string "device"
proto_config_add_boolean "nohostroute"
} }
[ -n "$INCLUDE_ONLY" ] || { [ -n "$INCLUDE_ONLY" ] || {