Skip to content
  • Jon Paul Maloy's avatar
    tipc: use bearer index when looking up active links · 36e78a46
    Jon Paul Maloy authored
    
    
    struct tipc_node currently holds two arrays of link pointers; one,
    indexed by bearer identity, which contains all links irrespective of
    current state, and one two-slot array for the currently active link
    or links. The latter array contains direct pointers into the elements
    of the former. This has the effect that we cannot know the bearer id of
    a link when accessing it via the "active_links[]" array without actually
    dereferencing the pointer, something we want to avoid in some cases.
    
    In this commit, we do instead store the bearer identity in the
    "active_links" array, and use this as an index to find the right element
    in the overall link entry array. This change should be seen as a
    preparation for the later commits in this series.
    
    Reviewed-by: default avatarYing Xue <ying.xue@windriver.com>
    Signed-off-by: default avatarJon Maloy <jon.maloy@ericsson.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    36e78a46