From 5d0f8bead56a19862ac1e5a9dbd30797e24be6b4 Mon Sep 17 00:00:00 2001
From: hkk <hankangkang5@huawei.com>
Date: Sat, 10 Aug 2024 17:11:55 +0800
Subject: [PATCH] virtio_user: The program establishes a network connection
 when network card status is up

---
 src/lstack/core/lstack_virtio.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/lstack/core/lstack_virtio.c b/src/lstack/core/lstack_virtio.c
index f95b289..b8114e8 100644
--- a/src/lstack/core/lstack_virtio.c
+++ b/src/lstack/core/lstack_virtio.c
@@ -147,6 +147,13 @@ static int virtio_netif_up(void)
     }
 
     posix_api->close_fn(sockfd);
+    /*
+    * For virtio_user IPv6 addresses, the kernel will check if they are valid,
+    * so wait a few seconds for the address status to change from scope global tentative to scope global.
+    * 3:systerm check ipv6 addr
+    */
+    sleep(3);
+
     return 0;
 }
 
-- 
2.33.0

