ifconfig: Support ifconfig interface and update arg limit

From comment in cmd_ifconfig, it seems that we support `ifconfig [interface]`, but actually not considering the interface param now. After this commit, we only print the information of interface specified in param, just like linux.

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
This commit is contained in:
Zhe Weng
2022-12-29 15:35:26 +08:00
committed by Xiang Xiao
parent a275567ad0
commit 93b4dc2692
3 changed files with 10 additions and 4 deletions

View File

@@ -595,6 +595,11 @@ int cmd_ifconfig(FAR struct nsh_vtbl_s *vtbl, int argc, FAR char **argv)
if (argc <= 2)
{
if (argc == 2)
{
return ifconfig_callback(vtbl, argv[1]);
}
ret = nsh_foreach_netdev(ifconfig_callback, vtbl, "ifconfig");
if (ret < 0)
{