Skip to content
  • Eric Blake's avatar
    c8720ca0
    nbd/server: Prepare to receive extended header requests · c8720ca0
    Eric Blake authored
    
    
    Although extended mode is not yet enabled, once we do turn it on, we
    need to accept extended requests for all messages.  Previous patches
    have already taken care of supporting 64-bit lengths, now we just need
    to read it off the wire.
    
    Note that this implementation will block indefinitely on a buggy
    client that sends a non-extended payload (that is, we try to read a
    full packet before we ever check the magic number, but a client that
    mistakenly sends a simple request after negotiating extended headers
    doesn't send us enough bytes), but it's no different from any other
    client that stops talking to us partway through a packet and thus not
    worth coding around.
    
    Signed-off-by: default avatarEric Blake <eblake@redhat.com>
    Reviewed-by: default avatarVladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
    Message-ID: <20230925192229.3186470-16-eblake@redhat.com>
    c8720ca0
    nbd/server: Prepare to receive extended header requests
    Eric Blake authored
    
    
    Although extended mode is not yet enabled, once we do turn it on, we
    need to accept extended requests for all messages.  Previous patches
    have already taken care of supporting 64-bit lengths, now we just need
    to read it off the wire.
    
    Note that this implementation will block indefinitely on a buggy
    client that sends a non-extended payload (that is, we try to read a
    full packet before we ever check the magic number, but a client that
    mistakenly sends a simple request after negotiating extended headers
    doesn't send us enough bytes), but it's no different from any other
    client that stops talking to us partway through a packet and thus not
    worth coding around.
    
    Signed-off-by: default avatarEric Blake <eblake@redhat.com>
    Reviewed-by: default avatarVladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
    Message-ID: <20230925192229.3186470-16-eblake@redhat.com>
Loading