aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/tipc_config.h4
-rw-r--r--net/tipc/link.c3
2 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/tipc_config.h b/include/linux/tipc_config.h
index 7d42460a5e3c..c14102dee22e 100644
--- a/include/linux/tipc_config.h
+++ b/include/linux/tipc_config.h
@@ -193,6 +193,10 @@
193#define TIPC_DEF_LINK_TOL 1500 193#define TIPC_DEF_LINK_TOL 1500
194#define TIPC_MAX_LINK_TOL 30000 194#define TIPC_MAX_LINK_TOL 30000
195 195
196#if (TIPC_MIN_LINK_TOL < 16)
197#error "TIPC_MIN_LINK_TOL is too small (abort limit may be NaN)"
198#endif
199
196/* 200/*
197 * Link window limits (min, default, max), in packets 201 * Link window limits (min, default, max), in packets
198 */ 202 */
diff --git a/net/tipc/link.c b/net/tipc/link.c
index 1c5c53a81531..3c1c28cdbaa4 100644
--- a/net/tipc/link.c
+++ b/net/tipc/link.c
@@ -2617,6 +2617,9 @@ static void link_check_defragm_bufs(struct link *l_ptr)
2617 2617
2618static void link_set_supervision_props(struct link *l_ptr, u32 tolerance) 2618static void link_set_supervision_props(struct link *l_ptr, u32 tolerance)
2619{ 2619{
2620 if ((tolerance < TIPC_MIN_LINK_TOL) || (tolerance > TIPC_MAX_LINK_TOL))
2621 return;
2622
2620 l_ptr->tolerance = tolerance; 2623 l_ptr->tolerance = tolerance;
2621 l_ptr->continuity_interval = 2624 l_ptr->continuity_interval =
2622 ((tolerance / 4) > 500) ? 500 : tolerance / 4; 2625 ((tolerance / 4) > 500) ? 500 : tolerance / 4;