Ignore NLMSG_DONE Netlink messages in dpif.

Otherwise the secchan considers the NLMSG_DONE at the end of a stats
dump to be an error and disconnects from the netlink connection.

Thanks to Martin for discovering the problem.
This commit is contained in:
Ben Pfaff committed 2008-05-28 16:03:36 -07:00
1 parent 051ea3978c
commit 3d8bf698e7
1 file changed
+4 -1
+4 -1
View File
@@ -135,7 +135,10 @@ dpif_recv_openflow(struct dpif *dp, struct buffer **bufferp,
do {
buffer_delete(buffer);
retval = nl_sock_recv(dp->sock, &buffer, wait);
} while (retval == ENOBUFS || (!retval && nl_msg_nlmsgerr(buffer, NULL)));
} while (retval == ENOBUFS
|| (!retval
&& (nl_msg_nlmsgerr(buffer, NULL)
|| nl_msg_nlmsghdr(buffer)->nlmsg_type == NLMSG_DONE)));
if (retval) {
if (retval != EAGAIN) {
VLOG_WARN("dpif_recv_openflow: %s", strerror(retval));