summaryrefslogtreecommitdiffstats
path: root/main/opennhrp/0001-config-really-fix-holding-time-to-apply-to-shortcut-.patch
blob: da1e8ffefa63b048177e52733c455e5c2160b051 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
From 3554acce7fec0ce6e7560444c5e3975affb78260 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timo=20Ter=C3=A4s?= <timo.teras@iki.fi>
Date: Tue, 18 Oct 2011 10:56:16 -0400
Subject: [PATCH] config: really fix holding-time to apply to shortcut-target

commit 94d1a7d4884346a5ba830ac209e1b746d23ec0c1 was supposed to
fix it, but it didn't fix resetting of the peer variable properly.
---
 nhrp/opennhrp.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/nhrp/opennhrp.c b/nhrp/opennhrp.c
index f2ecd44..0ff34ea 100644
--- a/nhrp/opennhrp.c
+++ b/nhrp/opennhrp.c
@@ -243,15 +243,16 @@ static int load_config(const char *config_file)
 			NEED_PEER();
 			peer->flags |= NHRP_PEER_FLAG_CISCO;
 		} else if (strcmp(word, "holding-time") == 0) {
-			peer = NULL;
 			read_word(in, &lineno, sizeof(word), word);
 			if (peer != NULL &&
-				 peer->type == NHRP_PEER_TYPE_LOCAL_ADDR)
+			    peer->type == NHRP_PEER_TYPE_LOCAL_ADDR) {
 				peer->holding_time = atoi(word);
-			else if (iface != NULL)
+			} else if (iface != NULL) {
 				iface->holding_time = atoi(word);
-			else
+				peer = NULL;
+			} else {
 				rc = 7;
+			}
 		} else if (strcmp(word, "cisco-authentication") == 0) {
 			struct nhrp_buffer *buf;
 			struct nhrp_cisco_authentication_extension *auth;
-- 
1.7.4.1