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

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

commit 4cec3dad0d103d5371b1e9fb7d4bfa1983c950d3
Author: zhanghongyu <[email protected]>
AuthorDate: Mon Oct 28 20:09:23 2024 +0800

    nsh_netcmds.c: handle the ENETUNREACH error number
    
    before:
    server> arp -a 10.0.1.4
    nsh: arp: ioctl failed: 101
    
    after:
    server> arp -a 10.0.1.4
    nsh: arp: no such ARP entry: 10.0.1.4
    
    Signed-off-by: zhanghongyu <[email protected]>
---
 nshlib/nsh_netcmds.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/nshlib/nsh_netcmds.c b/nshlib/nsh_netcmds.c
index e60181f2d..cc49771c7 100644
--- a/nshlib/nsh_netcmds.c
+++ b/nshlib/nsh_netcmds.c
@@ -1326,7 +1326,7 @@ int cmd_arp(FAR struct nsh_vtbl_s *vtbl, int argc, FAR 
char **argv)
   /* Error exits */
 
 errout_cmdfaild:
-  if (ret == -ENOENT)
+  if (ret == -ENOENT || ret == -ENETUNREACH)
     {
       nsh_error(vtbl, g_fmtnosuch, argv[0], "ARP entry", argv[optind]);
     }

Reply via email to