If the netlink socket overflows, we report an empty change to let all
notifiers know some events are lost and therefore they can no longer
trust their known state. This acts as a kind of reset.

Draining the socket makes sense here so that partial events are not
sent afterwards.

Signed-off-by: Adrian Moreno <[email protected]>
---
 lib/netlink-notifier.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/netlink-notifier.c b/lib/netlink-notifier.c
index 7ea5a4181..ea4742a90 100644
--- a/lib/netlink-notifier.c
+++ b/lib/netlink-notifier.c
@@ -200,6 +200,7 @@ nln_run(struct nln *nln)
             return;
         } else {
             if (error == ENOBUFS) {
+                nl_sock_drain(nln->notify_sock);
                 /* The socket buffer might be full, there could be too many
                  * notifications, so it makes sense to call nln_report() */
                 nln_report(nln, NULL, 0);
-- 
2.52.0

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to