• Hoang Le's avatar
    tipc: fix node keep alive interval calculation · afe10edd
    Hoang Le authored
    [ Upstream commit f5d6c3e5 ]
    
    When setting LINK tolerance, node timer interval will be calculated
    base on the LINK with lowest tolerance.
    
    But when calculated, the old node timer interval only updated if current
    setting value (tolerance/4) less than old ones regardless of number of
    links as well as links' lowest tolerance value.
    
    This caused to two cases missing if tolerance changed as following:
    Case 1:
    1.1/ There is one link (L1) available in the system
    1.2/ Set L1's tolerance from 1500ms => lower (i.e 500ms)
    1.3/ Then, fallback to default (1500ms) or higher (i.e 2000ms)
    
    Expected:
        node timer interval is 1500/4=375ms after 1.3
    
    Result:
    node timer interval will not being updated after changing tolerance at 1.3
    since its value 1500/4=375ms is not less than 500/4=125ms at 1.2.
    
    Case 2:
    2.1/ There are two links (L1, L2) available in the system
    2.2/ L1 and L2 tolerance value are 2000ms as initial
    2.3/ Set L2's tolerance from 2000ms => lower 1500ms
    2.4/ Disable link L2 (bring down its bearer)
    
    Expected:
        node timer interval is 2000ms/4=500ms after 2.4
    
    Result:
    node timer interval will not being updated after disabling L2 since
    its value 2000ms/4=500ms is still not less than 1500/4=375ms at 2.3
    although L2 is already not available in the system.
    
    To fix this, we start the node interval calculation by initializing it to
    a value larger than any conceivable calculated value. This way, the link
    with the lowest tolerance will always determine the calculated value.
    Acked-by: 's avatarJon Maloy <jon.maloy@ericsson.com>
    Signed-off-by: 's avatarHoang Le <hoang.h.le@dektech.com.au>
    Signed-off-by: 's avatarDavid S. Miller <davem@davemloft.net>
    Signed-off-by: 's avatarSasha Levin <sashal@kernel.org>
    afe10edd
Name
Last commit
Last update
..
Kconfig Loading commit data...
Makefile Loading commit data...
addr.c Loading commit data...
addr.h Loading commit data...
bcast.c Loading commit data...
bcast.h Loading commit data...
bearer.c Loading commit data...
bearer.h Loading commit data...
core.c Loading commit data...
core.h Loading commit data...
diag.c Loading commit data...
discover.c Loading commit data...
discover.h Loading commit data...
eth_media.c Loading commit data...
group.c Loading commit data...
group.h Loading commit data...
ib_media.c Loading commit data...
link.c Loading commit data...
link.h Loading commit data...
monitor.c Loading commit data...
monitor.h Loading commit data...
msg.c Loading commit data...
msg.h Loading commit data...
name_distr.c Loading commit data...
name_distr.h Loading commit data...
name_table.c Loading commit data...
name_table.h Loading commit data...
net.c Loading commit data...
net.h Loading commit data...
netlink.c Loading commit data...
netlink.h Loading commit data...
netlink_compat.c Loading commit data...
node.c Loading commit data...
node.h Loading commit data...
socket.c Loading commit data...
socket.h Loading commit data...
subscr.c Loading commit data...
subscr.h Loading commit data...
sysctl.c Loading commit data...
topsrv.c Loading commit data...
topsrv.h Loading commit data...
udp_media.c Loading commit data...
udp_media.h Loading commit data...