• Xin Long's avatar
    sctp: add udphdr to overhead when udp_port is set · f1bfe8b5
    Xin Long authored
    sctp_mtu_payload() is for calculating the frag size before making
    chunks from a msg. So we should only add udphdr size to overhead
    when udp socks are listening, as only then sctp can handle the
    incoming sctp over udp packets and outgoing sctp over udp packets
    will be possible.
    
    Note that we can't do this according to transport->encap_port, as
    different transports may be set to different values, while the
    chunks were made before choosing the transport, we could not be
    able to meet all rfc6951#section-5.6 recommends.
    
    v1->v2:
      - Add udp_port for sctp_sock to avoid a potential race issue, it
        will be used in xmit path in the next patch.
    Signed-off-by: default avatarXin Long <lucien.xin@gmail.com>
    Acked-by: default avatarMarcelo Ricardo Leitner <marcelo.leitner@gmail.com>
    Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
    f1bfe8b5
socket.c 261 KB