Skip to content
  • Geir Ola Vaagland's avatar
    net: sctp: implement rfc6458, 5.3.6. SCTP_NXTINFO cmsg support · 2347c80f
    Geir Ola Vaagland authored
    
    
    This patch implements section 5.3.6. of RFC6458, that is, support
    for 'SCTP Next Receive Information Structure' (SCTP_NXTINFO) which
    is placed into ancillary data cmsghdr structure for each recvmsg()
    call, if this information is already available when delivering the
    current message.
    
    This option can be enabled/disabled via setsockopt(2) on SOL_SCTP
    level by setting an int value with 1/0 for SCTP_RECVNXTINFO in
    user space applications as per RFC6458, section 8.1.30.
    
    The sctp_nxtinfo structure is defined as per RFC as below ...
    
      struct sctp_nxtinfo {
        uint16_t nxt_sid;
        uint16_t nxt_flags;
        uint32_t nxt_ppid;
        uint32_t nxt_length;
        sctp_assoc_t nxt_assoc_id;
      };
    
    ... and provided under cmsg_level IPPROTO_SCTP, cmsg_type
    SCTP_NXTINFO, while cmsg_data[] contains struct sctp_nxtinfo.
    
    Joint work with Daniel Borkmann.
    
    Signed-off-by: default avatarGeir Ola Vaagland <geirola@gmail.com>
    Signed-off-by: default avatarDaniel Borkmann <dborkman@redhat.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    2347c80f