This is an automated email from the ASF dual-hosted git repository.

GUIDINGLI pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git

commit 2e11b8bb0f51a2f50375119fb2450ff87b27b673
Author: wenquan1 <[email protected]>
AuthorDate: Thu May 21 15:43:27 2026 +0800

    netutils/netlib: extend netlib_check_ifconflict return value
    
    Extend netlib_check_ifconflict() to return ACD state:
    - 0: no conflict, ACD not active
    - 1: conflict detected
    - 2: ACD announcing in progress
    - <0: error
    
    Only check for (acd:ann) as in-progress state, allowing
    callers to keep polling until ACD finishes or conflict occurs.
    
    Signed-off-by: wenquan1 <[email protected]>
    Assisted-by: Kiro:claude-opus-4
---
 netutils/netlib/netlib_checkifconflict.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/netutils/netlib/netlib_checkifconflict.c 
b/netutils/netlib/netlib_checkifconflict.c
index 6e27efa12..b869ea4a1 100644
--- a/netutils/netlib/netlib_checkifconflict.c
+++ b/netutils/netlib/netlib_checkifconflict.c
@@ -56,13 +56,16 @@
  * Name: netlib_check_ifconflict
  *
  * Description:
- *   Check the network driver ip conflict
+ *   Check the network driver ip conflict and ACD state
  *
  * Parameters:
  *   ifname   The name of the interface to use
  *
  * Return:
- *   0 on no conflict; a nagtive on failure; 1 on conflict
+ *   0 on no conflict and ACD not active;
+ *   1 on conflict;
+ *   2 on ACD in progress or monitoring (announcing/finished);
+ *   a negative value on failure
  *
  ****************************************************************************/
 
@@ -96,6 +99,11 @@ int netlib_check_ifconflict(FAR const char *ifname)
           conflict = 1;
           break;
         }
+      else if (strstr(line, "acd:ann") != NULL)
+        {
+          conflict = 2;
+          break;
+        }
     }
 
   fclose(stream);

Reply via email to