aboutsummaryrefslogtreecommitdiffstats
path: root/main/opennhrp/reset-nat.patch
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2013-07-11 11:51:14 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2013-07-11 11:58:57 +0000
commite45437529c82cd5bcacb8589751faaaa69b481b6 (patch)
tree462b6d15e030ac83f629566c040b8f655a360d76 /main/opennhrp/reset-nat.patch
parent077f36e3ecdfe1b065d4a496b78875e1dec773c3 (diff)
downloadaports-e45437529c82cd5bcacb8589751faaaa69b481b6.tar.gz
aports-e45437529c82cd5bcacb8589751faaaa69b481b6.tar.bz2
aports-e45437529c82cd5bcacb8589751faaaa69b481b6.tar.xz
main/opennhrp: reset NAT after broken routing
fixes a corner case that system had broken routing (typically due to dual ISP), it gets fixed without changing gre interface. (cherry picked from commit 8d00aea74fced42fcd83ce32f4d10fb1fba4fc75)
Diffstat (limited to 'main/opennhrp/reset-nat.patch')
-rw-r--r--main/opennhrp/reset-nat.patch25
1 files changed, 25 insertions, 0 deletions
diff --git a/main/opennhrp/reset-nat.patch b/main/opennhrp/reset-nat.patch
new file mode 100644
index 0000000000..5c8ebccecb
--- /dev/null
+++ b/main/opennhrp/reset-nat.patch
@@ -0,0 +1,25 @@
+commit 578db3f65caec301ceb402e5c7b51624ed1c4576 (HEAD, origin/master, origin/HEAD, master)
+Author: Timo Teräs <timo.teras@iki.fi>
+Date: Thu Jul 11 14:14:15 2013 +0300
+
+ peer: reset interface nat cie when server does not detect nat
+
+ fixes a corner case that system had broken routing, it gets fixed
+ without changing gre interface. for normal operation the nat cie is
+ reset by gre interface change hooks.
+
+diff --git a/nhrp/nhrp_peer.c b/nhrp/nhrp_peer.c
+index 97bbe48..2dbdeea 100644
+--- a/nhrp/nhrp_peer.c
++++ b/nhrp/nhrp_peer.c
+@@ -1001,6 +1001,9 @@ static void nhrp_peer_handle_registration_reply(void *ctx,
+ peer->interface->nat_cie = *cie;
+ }
+ }
++ if (payload == NULL || cie == NULL)
++ memset(&peer->interface->nat_cie, 0,
++ sizeof(peer->interface->nat_cie));
+
+ /* If not re-registration, send a purge request for each subnet
+ * we accept shortcuts to, to clear server redirection cache. */
+