• Xin Long's avatar
    sctp: set new_asoc temp when processing dupcookie · 7e062977
    Xin Long authored
    After sctp changed to use transport hashtable, a transport would be
    added into global hashtable when adding the peer to an asoc, then
    the asoc can be got by searching the transport in the hashtbale.
    
    The problem is when processing dupcookie in sctp_sf_do_5_2_4_dupcook,
    a new asoc would be created. A peer with the same addr and port as
    the one in the old asoc might be added into the new asoc, but fail
    to be added into the hashtable, as they also belong to the same sk.
    
    It causes that sctp's dupcookie processing can not really work.
    
    Since the new asoc will be freed after copying it's information to
    the old asoc, it's more like a temp asoc. So this patch is to fix
    it by setting it as a temp asoc to avoid adding it's any transport
    into the hashtable and also avoid allocing assoc_id.
    
    An extra thing it has to do is to also alloc stream info for any
    temp asoc, as sctp dupcookie process needs it to update old asoc.
    But I don't think it would hurt something, as a temp asoc would
    always be freed after finishing processing cookie echo packet.
    Reported-by: default avatarJianwen Ji <jiji@redhat.com>
    Signed-off-by: default avatarXin Long <lucien.xin@gmail.com>
    Acked-by: default avatarNeil Horman <nhorman@tuxdriver.com>
    Acked-by: default avatarVlad Yasevich <vyasevich@gmail.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    7e062977
sm_statefuns.c 201 KB