From: Ben Pfaff Date: Wed, 28 May 2008 23:03:36 +0000 (-0700) Subject: Ignore NLMSG_DONE Netlink messages in dpif. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3d8bf698e7189bf966bab6bce5c48e616f4b14eb;p=openvswitch 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. --- diff --git a/lib/dpif.c b/lib/dpif.c index b5b4fb4b..506efe3d 100644 --- a/lib/dpif.c +++ b/lib/dpif.c @@ -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));