[PATCH v2 4/6] nsiproxy.sys: Update interface table only if LUID is not found in convert_unix_name_to_luid().

Paul Gofman wine at gitlab.winehq.org
Tue May 17 08:31:00 CDT 2022


From: Paul Gofman <pgofman at codeweavers.com>

Signed-off-by: Paul Gofman <pgofman at codeweavers.com>
---
 dlls/nsiproxy.sys/ndis.c | 22 ++++++++++++++--------
 1 file changed, 14 insertions(+), 8 deletions(-)

diff --git a/dlls/nsiproxy.sys/ndis.c b/dlls/nsiproxy.sys/ndis.c
index 152e808994e..47781d1db5d 100644
--- a/dlls/nsiproxy.sys/ndis.c
+++ b/dlls/nsiproxy.sys/ndis.c
@@ -613,18 +613,24 @@ BOOL convert_unix_name_to_luid( const char *unix_name, NET_LUID *luid )
 {
     struct if_entry *entry;
     BOOL ret = FALSE;
+    int updated = 0;
 
     pthread_mutex_lock( &if_list_lock );
 
-    update_if_table();
+    do
+    {
+        LIST_FOR_EACH_ENTRY( entry, &if_list, struct if_entry, entry )
+            if (!strcmp( entry->if_unix_name, unix_name ))
+            {
+                *luid = entry->if_luid;
+                ret = TRUE;
+                goto done;
+            }
+        update_if_table();
+    }
+    while (!updated++);
 
-    LIST_FOR_EACH_ENTRY( entry, &if_list, struct if_entry, entry )
-        if (!strcmp( entry->if_unix_name, unix_name ))
-        {
-            *luid = entry->if_luid;
-            ret = TRUE;
-            break;
-        }
+done:
     pthread_mutex_unlock( &if_list_lock );
 
     return ret;
-- 
GitLab


https://gitlab.winehq.org/wine/wine/-/merge_requests/78



More information about the wine-devel mailing list