• Jon Maloy's avatar
    tipc: receive group membership events via member socket · ae236fb2
    Jon Maloy authored
    Like with any other service, group members' availability can be
    subscribed for by connecting to be topology server. However, because
    the events arrive via a different socket than the member socket, there
    is a real risk that membership events my arrive out of synch with the
    actual JOIN/LEAVE action. I.e., it is possible to receive the first
    messages from a new member before the corresponding JOIN event arrives,
    just as it is possible to receive the last messages from a leaving
    member after the LEAVE event has already been received.
    
    Since each member socket is internally also subscribing for membership
    events, we now fix this problem by passing those events on to the user
    via the member socket. We leverage the already present member synch-
    ronization protocol to guarantee correct message/event order. An event
    is delivered to the user as an empty message where the two source
    addresses identify the new/lost member. Furthermore, we set the MSG_OOB
    bit in the message flags to mark it as an event. If the event is an
    indication about a member loss we also set the MSG_EOR bit, so it can
    be distinguished from a member addition event.
    Signed-off-by: default avatarJon Maloy <jon.maloy@ericsson.com>
    Acked-by: default avatarYing Xue <ying.xue@windriver.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    ae236fb2
msg.h 21.8 KB