This repository has been archived on 2025-03-20. You can view files and clone it, but cannot push or open issues or pull requests.
sonic-buildimage/src/lldpd/patch/0005-Read-all-notifications-in-lldpctl_recv.patch
pavel-shirshov f24ee3b49e [lldpd]: Ports few fixes from lldpd master (#3889)
* lldpctl: put a lock around some commands to avoid race conditions

* Read all notifications in lldpctl_recv

* lib: fix memory leak

* lib: fix memory leak when handling I/O

* Update series
2019-12-18 11:19:55 -08:00

28 lines
819 B
Diff

From b8e66b52f40103fd3abea77031c4634742c31860 Mon Sep 17 00:00:00 2001
From: Pavel Shirshov <pavelsh@microsoft.com>
Date: Thu, 12 Dec 2019 12:47:42 -0800
Subject: [PATCH 1/1] Read all notifications in lldpctl_recv
---
src/lib/connection.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/lib/connection.c b/src/lib/connection.c
index 591d9e9..88bbc99 100644
--- a/src/lib/connection.c
+++ b/src/lib/connection.c
@@ -253,8 +253,8 @@ lldpctl_recv(lldpctl_conn_t *conn, const uint8_t *data, size_t length)
memcpy(conn->input_buffer + conn->input_buffer_len, data, length);
conn->input_buffer_len += length;
- /* Is it a notification? */
- check_for_notification(conn);
+ /* Read all notifications */
+ while(!check_for_notification(conn));
RESET_ERROR(conn);
--
2.17.1.windows.2