/*
- * Copyright (c) 2010, 2011 Nicira Networks.
+ * Copyright (c) 2010, 2011, 2012 Nicira Networks.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
{
struct netdev_dummy *netdev = netdev_dummy_cast(netdev_);
struct ofpbuf *packet;
+ size_t packet_size;
if (list_is_empty(&netdev->recv_queue)) {
return -EAGAIN;
if (packet->size > size) {
return -EMSGSIZE;
}
+ packet_size = packet->size;
memcpy(buffer, packet->data, packet->size);
ofpbuf_delete(packet);
- return packet->size;
+ return packet_size;
}
static void