Revision 3777b09f nbd.c

b/nbd.c
585 585

  
586 586
int nbd_trip(BlockDriverState *bs, int csock, off_t size,
587 587
             uint64_t dev_offset, uint32_t nbdflags,
588
             uint8_t *data, int data_size)
588
             uint8_t *data)
589 589
{
590 590
    struct nbd_request request;
591 591
    struct nbd_reply reply;
......
596 596
    if (nbd_receive_request(csock, &request) == -1)
597 597
        return -1;
598 598

  
599
    if (request.len + NBD_REPLY_SIZE > data_size) {
599
    if (request.len + NBD_REPLY_SIZE > NBD_BUFFER_SIZE) {
600 600
        LOG("len (%u) is larger than max len (%u)",
601
            request.len + NBD_REPLY_SIZE, data_size);
601
            request.len + NBD_REPLY_SIZE, NBD_BUFFER_SIZE);
602 602
        errno = EINVAL;
603 603
        return -1;
604 604
    }

Also available in: Unified diff