Merge pull request #2829 from Guozhanxin/netdev_fix

[netdev] Add a non-null judgment to the netstat command.
This commit is contained in:
Bernard Xiong 2019-07-04 11:28:35 +08:00 committed by GitHub
commit add4037764
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 1 deletions

View File

@ -1159,7 +1159,14 @@ static void netdev_cmd_netstat(void)
} }
} }
netdev->ops->netstat(netdev); if (netdev->ops->netstat != RT_NULL)
{
netdev->ops->netstat(netdev);
}
else
{
rt_kprintf("netstat: this command is not supported!\n");
}
} }
int netdev_netstat(int argc, char **argv) int netdev_netstat(int argc, char **argv)