• Xin Long's avatar
    sctp: create udp4 sock and add its encap_rcv · 965ae444
    Xin Long authored
    This patch is to add the functions to create/release udp4 sock,
    and set the sock's encap_rcv to process the incoming udp encap
    sctp packets. In sctp_udp_rcv(), as we can see, all we need to
    do is fix the transport header for sctp_rcv(), then it would
    implement the part of rfc6951#section-5.4:
    
      "When an encapsulated packet is received, the UDP header is removed.
       Then, the generic lookup is performed, as done by an SCTP stack
       whenever a packet is received, to find the association for the
       received SCTP packet"
    
    Note that these functions will be called in the last patch of
    this patchset when enabling this feature.
    
    v1->v2:
      - Add pr_err() when fails to create udp v4 sock.
    v2->v3:
      - Add 'select NET_UDP_TUNNEL' in sctp Kconfig.
    v3->v4:
      - No change.
    v4->v5:
      - Change to set udp_port to 0 by default.
    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>
    965ae444
sctp.h 4.43 KB