/*
- * Copyright (c) 2008, 2009, 2010, 2011, 2012 Nicira Networks.
+ * Copyright (c) 2008, 2009, 2010, 2011, 2012 Nicira, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
}
static int
-dpif_linux_recv(struct dpif *dpif_, struct dpif_upcall *upcall)
+dpif_linux_recv(struct dpif *dpif_, struct dpif_upcall *upcall,
+ struct ofpbuf *buf)
{
struct dpif_linux *dpif = dpif_linux_cast(dpif_);
int read_tries = 0;
dpif->ready_mask &= ~(1u << indx);
for (;;) {
- struct ofpbuf *buf;
int dp_ifindex;
int error;
return EAGAIN;
}
- buf = ofpbuf_new(2048);
error = nl_sock_recv(upcall_sock, buf, false);
if (error) {
- ofpbuf_delete(buf);
if (error == EAGAIN) {
break;
}
if (!error && dp_ifindex == dpif->dp_ifindex) {
return 0;
}
-
- ofpbuf_delete(buf);
if (error) {
return error;
}