It is not always necessary to add a host route for the gre peer address.
This introduces a new config option 'nohostroute' (similar to the
option introduced for wireguard in
d8e2e19) to allow to disable
the creation of those routes explicitely.
Signed-off-by: Fabian Bläse <fabian@blaese.de>
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com> [PKG_RELEASE increase]
PKG_NAME:=gre
PKG_VERSION:=1
PKG_NAME:=gre
PKG_VERSION:=1
PKG_LICENSE:=GPL-2.0
include $(INCLUDE_DIR)/package.mk
PKG_LICENSE:=GPL-2.0
include $(INCLUDE_DIR)/package.mk
local remoteip
local ipaddr peeraddr
local remoteip
local ipaddr peeraddr
- json_get_vars df ipaddr peeraddr tunlink
+ json_get_vars df ipaddr peeraddr tunlink nohostroute
[ -z "$peeraddr" ] && {
proto_notify_error "$cfg" "MISSING_PEER_ADDRESS"
[ -z "$peeraddr" ] && {
proto_notify_error "$cfg" "MISSING_PEER_ADDRESS"
- ( proto_add_host_dependency "$cfg" "$peeraddr" "$tunlink" )
+ if [ "${nohostroute}" != "1" ]; then
+ ( proto_add_host_dependency "$cfg" "$peeraddr" "$tunlink" )
+ fi
[ -z "$ipaddr" ] && {
local wanif="$tunlink"
[ -z "$ipaddr" ] && {
local wanif="$tunlink"
local remoteip6
local ip6addr peer6addr weakif
local remoteip6
local ip6addr peer6addr weakif
- json_get_vars ip6addr peer6addr tunlink weakif encaplimit
+ json_get_vars ip6addr peer6addr tunlink weakif encaplimit nohostroute
[ -z "$peer6addr" ] && {
proto_notify_error "$cfg" "MISSING_PEER_ADDRESS"
[ -z "$peer6addr" ] && {
proto_notify_error "$cfg" "MISSING_PEER_ADDRESS"
- ( proto_add_host_dependency "$cfg" "$peer6addr" "$tunlink" )
+ if [ "${nohostroute}" != "1" ]; then
+ ( proto_add_host_dependency "$cfg" "$peer6addr" "$tunlink" )
+ fi
[ -z "$ip6addr" ] && {
local wanif="$tunlink"
[ -z "$ip6addr" ] && {
local wanif="$tunlink"
proto_config_add_string "ipaddr"
proto_config_add_string "peeraddr"
proto_config_add_boolean "df"
proto_config_add_string "ipaddr"
proto_config_add_string "peeraddr"
proto_config_add_boolean "df"
+ proto_config_add_boolean "nohostroute"
}
proto_gretap_init_config() {
}
proto_gretap_init_config() {
proto_config_add_string "peer6addr"
proto_config_add_string "weakif"
proto_config_add_string "encaplimit"
proto_config_add_string "peer6addr"
proto_config_add_string "weakif"
proto_config_add_string "encaplimit"
+ proto_config_add_boolean "nohostroute"
}
proto_grev6tap_init_config() {
}
proto_grev6tap_init_config() {