diff options
Diffstat (limited to 'net/tipc/node.c')
-rw-r--r-- | net/tipc/node.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/net/tipc/node.c b/net/tipc/node.c index c7985b2cb759..d6a490f991a4 100644 --- a/net/tipc/node.c +++ b/net/tipc/node.c | |||
@@ -378,14 +378,13 @@ static void tipc_node_calculate_timer(struct tipc_node *n, struct tipc_link *l) | |||
378 | { | 378 | { |
379 | unsigned long tol = tipc_link_tolerance(l); | 379 | unsigned long tol = tipc_link_tolerance(l); |
380 | unsigned long intv = ((tol / 4) > 500) ? 500 : tol / 4; | 380 | unsigned long intv = ((tol / 4) > 500) ? 500 : tol / 4; |
381 | unsigned long keepalive_intv = msecs_to_jiffies(intv); | ||
382 | 381 | ||
383 | /* Link with lowest tolerance determines timer interval */ | 382 | /* Link with lowest tolerance determines timer interval */ |
384 | if (keepalive_intv < n->keepalive_intv) | 383 | if (intv < n->keepalive_intv) |
385 | n->keepalive_intv = keepalive_intv; | 384 | n->keepalive_intv = intv; |
386 | 385 | ||
387 | /* Ensure link's abort limit corresponds to current interval */ | 386 | /* Ensure link's abort limit corresponds to current tolerance */ |
388 | tipc_link_set_abort_limit(l, tol / jiffies_to_msecs(n->keepalive_intv)); | 387 | tipc_link_set_abort_limit(l, tol / n->keepalive_intv); |
389 | } | 388 | } |
390 | 389 | ||
391 | static void tipc_node_delete(struct tipc_node *node) | 390 | static void tipc_node_delete(struct tipc_node *node) |
@@ -526,7 +525,7 @@ static void tipc_node_timeout(unsigned long data) | |||
526 | if (rc & TIPC_LINK_DOWN_EVT) | 525 | if (rc & TIPC_LINK_DOWN_EVT) |
527 | tipc_node_link_down(n, bearer_id, false); | 526 | tipc_node_link_down(n, bearer_id, false); |
528 | } | 527 | } |
529 | mod_timer(&n->timer, jiffies + n->keepalive_intv); | 528 | mod_timer(&n->timer, jiffies + msecs_to_jiffies(n->keepalive_intv)); |
530 | } | 529 | } |
531 | 530 | ||
532 | /** | 531 | /** |
@@ -735,6 +734,7 @@ void tipc_node_check_dest(struct net *net, u32 onode, | |||
735 | bool accept_addr = false; | 734 | bool accept_addr = false; |
736 | bool reset = true; | 735 | bool reset = true; |
737 | char *if_name; | 736 | char *if_name; |
737 | unsigned long intv; | ||
738 | 738 | ||
739 | *dupl_addr = false; | 739 | *dupl_addr = false; |
740 | *respond = false; | 740 | *respond = false; |
@@ -840,9 +840,11 @@ void tipc_node_check_dest(struct net *net, u32 onode, | |||
840 | le->link = l; | 840 | le->link = l; |
841 | n->link_cnt++; | 841 | n->link_cnt++; |
842 | tipc_node_calculate_timer(n, l); | 842 | tipc_node_calculate_timer(n, l); |
843 | if (n->link_cnt == 1) | 843 | if (n->link_cnt == 1) { |
844 | if (!mod_timer(&n->timer, jiffies + n->keepalive_intv)) | 844 | intv = jiffies + msecs_to_jiffies(n->keepalive_intv); |
845 | if (!mod_timer(&n->timer, intv)) | ||
845 | tipc_node_get(n); | 846 | tipc_node_get(n); |
847 | } | ||
846 | } | 848 | } |
847 | memcpy(&le->maddr, maddr, sizeof(*maddr)); | 849 | memcpy(&le->maddr, maddr, sizeof(*maddr)); |
848 | exit: | 850 | exit: |