[Olsr-dev] [PATCH v1 075/115] info: write_data: do not add invalid sockets to the FD set

Ferry Huberts (spam-protected)
Wed Dec 2 21:28:48 CET 2015


From: Ferry Huberts <(spam-protected)>

Signed-off-by: Ferry Huberts <(spam-protected)>
---
 lib/info/olsrd_info.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lib/info/olsrd_info.c b/lib/info/olsrd_info.c
index 4866aa7..f102d94 100644
--- a/lib/info/olsrd_info.c
+++ b/lib/info/olsrd_info.c
@@ -159,6 +159,10 @@ static void write_data(void *foo __attribute__ ((unused))) {
   FD_ZERO(&set);
   max = 0;
   for (i = 0; i < outbuffer.count; i++) {
+    if (outbuffer.socket[i] < 0) {
+      continue;
+    }
+
     /* And we cast here since we get a warning on Win32 */
     FD_SET((unsigned int ) (outbuffer.socket[i]), &set);
 
-- 
2.5.0




More information about the Olsr-dev mailing list