diff mbox series

[ovs-dev,v1,4/9] netlink-notifier: Drain socket on overflow.

Message ID 20251222152356.301762-5-amorenoz@redhat.com
State New
Headers show
Series netdev-linux: Use event-driven netlink notifications. | expand

Checks

Context Check Description
ovsrobot/apply-robot success apply and check: success
ovsrobot/github-robot-_Build_and_Test success github build: passed

Commit Message

Adrián Moreno Dec. 22, 2025, 3:23 p.m. UTC
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 <amorenoz@redhat.com>
---
 lib/netlink-notifier.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

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);