diff mbox series

[OpenWrt-Devel] gre: introduce 'nohostroute' option

Message ID mailman.42638.1558865988.2376.openwrt-devel@lists.openwrt.org
State Changes Requested
Delegated to: Hans Dedecker
Headers show
Series [OpenWrt-Devel] gre: introduce 'nohostroute' option | expand

Commit Message

hurrhnn--- via openwrt-devel May 26, 2019, 10:19 a.m. UTC
The sender domain has a DMARC Reject/Quarantine policy which disallows
sending mailing list messages using the original "From" header.

To mitigate this problem, the original message has been wrapped
automatically by the mailing list software.
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>
---
 package/network/config/gre/files/gre.sh | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

Comments

Hans Dedecker May 26, 2019, 7:15 p.m. UTC | #1
Hi,
On Sun, May 26, 2019 at 12:19 PM Fabian Bläse via openwrt-devel
<openwrt-devel@lists.openwrt.org> wrote:
>
> The sender domain has a DMARC Reject/Quarantine policy which disallows
> sending mailing list messages using the original "From" header.
>
> To mitigate this problem, the original message has been wrapped
> automatically by the mailing list software.
>
>
> ---------- Forwarded message ----------
> From: "Fabian Bläse" <fabian@blaese.de>
> To: openwrt-devel@lists.openwrt.org
> Cc: "Fabian Bläse" <fabian@blaese.de>
> Bcc:
> Date: Sun, 26 May 2019 12:19:05 +0200
> Subject: [PATCH] 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>
Trying to apply the patch I get :

git am 1105538.patch
Patch is empty.
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

Please use git send-email to deliver the patch

Hans
> ---
>  package/network/config/gre/files/gre.sh | 14 ++++++++++----
>  1 file changed, 10 insertions(+), 4 deletions(-)
>
> 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() {
> --
> 2.21.0
>
>
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel@lists.openwrt.org
> https://lists.openwrt.org/mailman/listinfo/openwrt-devel
hurrhnn--- via openwrt-devel May 26, 2019, 7:47 p.m. UTC | #2
The sender domain has a DMARC Reject/Quarantine policy which disallows
sending mailing list messages using the original "From" header.

To mitigate this problem, the original message has been wrapped
automatically by the mailing list software.
Hi Hans,

I have sent this patch with git-send-mail and I am able to apply the attached message (which seems to be created due to my mailservers dmarc policy) which I have received from the mailing list..

I could try to temporarily remove this dmarc policy so my patch does not get embedded into another message by the mailing list.

Fabian

On 26.05.19 21:15, Hans Dedecker wrote:
> Hi,
> On Sun, May 26, 2019 at 12:19 PM Fabian Bläse via openwrt-devel
> <openwrt-devel@lists.openwrt.org> wrote:
>>
>> The sender domain has a DMARC Reject/Quarantine policy which disallows
>> sending mailing list messages using the original "From" header.
>>
>> To mitigate this problem, the original message has been wrapped
>> automatically by the mailing list software.
>>
>>
>> ---------- Forwarded message ----------
>> From: "Fabian Bläse" <fabian@blaese.de>
>> To: openwrt-devel@lists.openwrt.org
>> Cc: "Fabian Bläse" <fabian@blaese.de>
>> Bcc:
>> Date: Sun, 26 May 2019 12:19:05 +0200
>> Subject: [PATCH] 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>
> Trying to apply the patch I get :
> 
> git am 1105538.patch
> Patch is empty.
> When you have resolved this problem, run "git am --continue".
> If you prefer to skip this patch, run "git am --skip" instead.
> To restore the original branch and stop patching, run "git am --abort".
> 
> Please use git send-email to deliver the patch
> 
> Hans
Jeff Kletsky May 26, 2019, 11:39 p.m. UTC | #3
On 5/26/19 12:15 PM, Hans Dedecker wrote:

> Hi,
> On Sun, May 26, 2019 at 12:19 PM Fabian Bläse via openwrt-devel
> <openwrt-devel@lists.openwrt.org> wrote:
> [...]
> Please use git send-email to deliver the patch
>
> Hans
>> ---
>>   package/network/config/gre/files/gre.sh | 14 ++++++++++----
>>   1 file changed, 10 insertions(+), 4 deletions(-)
>>
>> 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
>> [...]

I can confirm the need to manage the routing generated by the call.
When I was using Layer 2, GRE tunnels I found that I had reverse
at least some of effect of the call to get routing to work properly.

I was unable to determine why the routing was being set as it was,
and crudely reversed it with
  
           ( proto_add_host_dependency "$cfg" "$peeraddr" "$tunlink" )
  
   +       # jmk -- hack for broken logic somewhere
   +
   +       ip route delete proto static "$peeraddr"
   +


Jeff
diff mbox series

Patch

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() {