[opennhrp-devel] [PATCH] peer: Registration callback timeout update
Brought to you by:
fabled80
From: Doug K. <rd...@ya...> - 2011-01-21 14:43:26
|
Update registration callback timeout to handle small holding time. RFC-2332 section 5.2.3 (last paragraph) recommends that NHRP Registration Request packet be sent at an interval of 1/3 the holding time. Signed-off-by: Doug Kehn <rd...@ya...> --- nhrp/nhrp_peer.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/nhrp/nhrp_peer.c b/nhrp/nhrp_peer.c index 1e48e25..554ad97 100644 --- a/nhrp/nhrp_peer.c +++ b/nhrp/nhrp_peer.c @@ -27,6 +27,8 @@ #define NHRP_NEGATIVE_CACHE_TIME (3*60) #define NHRP_EXPIRY_TIME (5*60) +#define NHRP_HOLDING_TIME_DIVISOR 3 /* See RFC-2332 5.2.3 */ + #define NHRP_RETRY_REGISTER_TIME (30 + random()/(RAND_MAX/60)) #define NHRP_RETRY_ERROR_TIME (60 + random()/(RAND_MAX/120)) @@ -670,7 +672,8 @@ static void nhrp_peer_is_up(struct nhrp_peer *peer) case NHRP_PEER_TYPE_DYNAMIC_NHS: if (peer->flags & NHRP_PEER_FLAG_REGISTER) { nhrp_peer_schedule( - peer, iface->holding_time - NHRP_EXPIRY_TIME, + peer, iface->holding_time / + NHRP_HOLDING_TIME_DIVISOR + 1, nhrp_peer_send_register_cb); } break; -- 1.7.1 |