• Tuong Lien's avatar
    tipc: fix failed service subscription deletion · 88690b10
    Tuong Lien authored
    When a service subscription is expired or canceled by user, it needs to
    be deleted from the subscription list, so that new subscriptions can be
    registered (max = 65535 per net). However, there are two issues in code
    that can cause such an unused subscription to persist:
    
    1) The 'tipc_conn_delete_sub()' has a loop on the subscription list but
    it makes a break shortly when the 1st subscription differs from the one
    specified, so the subscription will not be deleted.
    
    2) In case a subscription is canceled, the code to remove the
    'TIPC_SUB_CANCEL' flag from the subscription filter does not work if it
    is a local subscription (i.e. the little endian isn't involved). So, it
    will be no matches when looking for the subscription to delete later.
    
    The subscription(s) will be removed eventually when the user terminates
    its topology connection but that could be a long time later. Meanwhile,
    the number of available subscriptions may be exhausted.
    
    This commit fixes the two issues above, so as needed a subscription can
    be deleted correctly.
    Acked-by: default avatarYing Xue <ying.xue@windriver.com>
    Acked-by: default avatarJon Maloy <jmaloy@redhat.com>
    Signed-off-by: default avatarTuong Lien <tuong.t.lien@dektech.com.au>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    88690b10
subscr.h 4.39 KB