diff options
author | Fabian Bläse <fabian@blaese.de> | 2019-05-29 21:08:01 +0200 |
---|---|---|
committer | Hans Dedecker <dedeckeh@gmail.com> | 2019-05-31 09:42:32 +0200 |
commit | 0f8b9addfc4fd59a488f64289aadd82c127f00e6 (patch) | |
tree | b5ab469665fd34f7744b2f368e18ae261a2721e4 /package/network/config/gre | |
parent | cf463159df1bee537362d8faee8b1ac51e5bbfef (diff) | |
download | upstream-0f8b9addfc4fd59a488f64289aadd82c127f00e6.tar.gz upstream-0f8b9addfc4fd59a488f64289aadd82c127f00e6.tar.bz2 upstream-0f8b9addfc4fd59a488f64289aadd82c127f00e6.zip |
gre: introduce 'nohostroute' option
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]
Diffstat (limited to 'package/network/config/gre')
-rw-r--r-- | package/network/config/gre/Makefile | 2 | ||||
-rwxr-xr-x | package/network/config/gre/files/gre.sh | 14 |
2 files changed, 11 insertions, 5 deletions
diff --git a/package/network/config/gre/Makefile b/package/network/config/gre/Makefile index 6fe6d567b9..83ec8988af 100644 --- a/package/network/config/gre/Makefile +++ b/package/network/config/gre/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=gre PKG_VERSION:=1 -PKG_RELEASE:=10 +PKG_RELEASE:=11 PKG_LICENSE:=GPL-2.0 include $(INCLUDE_DIR)/package.mk diff --git a/package/network/config/gre/files/gre.sh b/package/network/config/gre/files/gre.sh index 2bb1010b76..3414ed3047 100755 --- a/package/network/config/gre/files/gre.sh +++ b/package/network/config/gre/files/gre.sh @@ -56,7 +56,7 @@ gre_setup() { 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" @@ -76,7 +76,9 @@ gre_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" @@ -133,7 +135,7 @@ grev6_setup() { 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" @@ -153,7 +155,9 @@ grev6_setup() { break done - ( proto_add_host_dependency "$cfg" "$peer6addr" "$tunlink" ) + if [ "${nohostroute}" != "1" ]; then + ( proto_add_host_dependency "$cfg" "$peer6addr" "$tunlink" ) + fi [ -z "$ip6addr" ] && { local wanif="$tunlink" @@ -262,6 +266,7 @@ proto_gre_init_config() { proto_config_add_string "ipaddr" proto_config_add_string "peeraddr" proto_config_add_boolean "df" + proto_config_add_boolean "nohostroute" } proto_gretap_init_config() { @@ -275,6 +280,7 @@ proto_grev6_init_config() { proto_config_add_string "peer6addr" proto_config_add_string "weakif" proto_config_add_string "encaplimit" + proto_config_add_boolean "nohostroute" } proto_grev6tap_init_config() { |