mirror of
https://github.com/openvswitch/ovs
synced 2025-09-05 08:45:23 +00:00
netlink-socket: New function for draining the receive buffer.
This will be used in an upcoming patch. Reviewed by Justin Pettit.
This commit is contained in:
@@ -28,6 +28,7 @@
|
||||
#include "netlink-protocol.h"
|
||||
#include "ofpbuf.h"
|
||||
#include "poll-loop.h"
|
||||
#include "socket-util.h"
|
||||
#include "stress.h"
|
||||
#include "vlog.h"
|
||||
|
||||
@@ -446,6 +447,13 @@ recv:
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Drain all the messages currently in 'sock''s receive queue. */
|
||||
int
|
||||
nl_sock_drain(struct nl_sock *sock)
|
||||
{
|
||||
return drain_rcvbuf(sock->fd);
|
||||
}
|
||||
|
||||
/* Starts a Netlink "dump" operation, by sending 'request' to the kernel via
|
||||
* 'sock', and initializes 'dump' to reflect the state of the operation.
|
||||
*
|
||||
|
Reference in New Issue
Block a user