gre: make encaplimit support configurable
authorHans Dedecker <dedeckeh@gmail.com>
Wed, 17 Oct 2018 09:02:05 +0000 (11:02 +0200)
committerHans Dedecker <dedeckeh@gmail.com>
Wed, 17 Oct 2018 09:18:20 +0000 (11:18 +0200)
Make inclusion of the destination option header containing the tunnel
encapsulation limit configurable for IPv6 GRE packets.
Setting the uci parameter encaplimit to ignore; allows to disable the
insertion of the destination option header in the IPv6 GRE packets.
Otherwise the tunnel encapsulation limit value can be set to a value
from 0 till 255 by setting the encaplimit uci parameter accordingly.

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
package/network/config/gre/Makefile
package/network/config/gre/files/gre.sh

index 73319e80cffbf655639bf1de36ee580cc28b1938..a7e8612c6ca8c53ee7e79fd5b13609b231959cb5 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=gre
 PKG_VERSION:=1
-PKG_RELEASE:=8
+PKG_RELEASE:=9
 PKG_LICENSE:=GPL-2.0
 
 include $(INCLUDE_DIR)/package.mk
index e604bfb259a990ad0cfe587449d0c67d8467b0fd..ca11e87cfd4502e547d1c255ec25223325d43a40 100755 (executable)
@@ -39,6 +39,7 @@ gre_generic_setup() {
        [ -n "$ocsum" ] && json_add_boolean ocsum "$ocsum"
        [ -n "$iseqno" ] && json_add_boolean iseqno "$iseqno"
        [ -n "$oseqno" ] && json_add_boolean oseqno "$oseqno"
+       [ -n "$encaplimit" ] && json_add_string encaplimit "$encaplimit"
        json_close_object
 
        proto_close_tunnel
@@ -133,7 +134,7 @@ grev6_setup() {
        local remoteip6
 
        local ip6addr peer6addr weakif
-       json_get_vars ip6addr peer6addr tunlink weakif
+       json_get_vars ip6addr peer6addr tunlink weakif encaplimit
 
        [ -z "$peer6addr" ] && {
                proto_notify_error "$cfg" "MISSING_PEER_ADDRESS"
@@ -274,6 +275,7 @@ proto_grev6_init_config() {
        proto_config_add_string "ip6addr"
        proto_config_add_string "peer6addr"
        proto_config_add_string "weakif"
+       proto_config_add_string "encaplimit"
 }
 
 proto_grev6tap_init_config() {