Skip to content
Snippets Groups Projects
  • Xin Long's avatar
    f4919ff5
    tipc: keep the skb in rcv queue until the whole data is read · f4919ff5
    Xin Long authored
    
    Currently, when userspace reads a datagram with a buffer that is
    smaller than this datagram, the data will be truncated and only
    part of it can be received by users. It doesn't seem right that
    users don't know the datagram size and have to use a huge buffer
    to read it to avoid the truncation.
    
    This patch to fix it by keeping the skb in rcv queue until the
    whole data is read by users. Only the last msg of the datagram
    will be marked with MSG_EOR, just as TCP/SCTP does.
    
    Note that this will work as above only when MSG_EOR is set in the
    flags parameter of recvmsg(), so that it won't break any old user
    applications.
    
    Signed-off-by: default avatarXin Long <lucien.xin@gmail.com>
    Acked-by: default avatarJon Maloy <jmaloy@redhat.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    f4919ff5
    History
    tipc: keep the skb in rcv queue until the whole data is read
    Xin Long authored
    
    Currently, when userspace reads a datagram with a buffer that is
    smaller than this datagram, the data will be truncated and only
    part of it can be received by users. It doesn't seem right that
    users don't know the datagram size and have to use a huge buffer
    to read it to avoid the truncation.
    
    This patch to fix it by keeping the skb in rcv queue until the
    whole data is read by users. Only the last msg of the datagram
    will be marked with MSG_EOR, just as TCP/SCTP does.
    
    Note that this will work as above only when MSG_EOR is set in the
    flags parameter of recvmsg(), so that it won't break any old user
    applications.
    
    Signed-off-by: default avatarXin Long <lucien.xin@gmail.com>
    Acked-by: default avatarJon Maloy <jmaloy@redhat.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>