Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions netutils/iperf/iperf.c
Original file line number Diff line number Diff line change
Expand Up @@ -220,13 +220,15 @@ static void iperf_print_addr(FAR const char *str, FAR struct sockaddr *addr)
{
switch (addr->sa_family)
{
#ifdef CONFIG_NET_IPv4
case AF_INET:
{
FAR struct sockaddr_in *inaddr = (FAR struct sockaddr_in *)addr;
printf("%s: %s:%d\n", str,
inet_ntoa(inaddr->sin_addr), htons(inaddr->sin_port));
return;
}
#endif

case AF_LOCAL:
{
Expand Down
8 changes: 8 additions & 0 deletions netutils/iperf/iperf_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,10 @@ int main(int argc, FAR char *argv[])
struct iperf_cfg_t cfg;
struct in_addr addr;
int nerrors;

#ifdef CONFIG_NET_IPv4
char inetaddr[INET_ADDRSTRLEN];
#endif

bzero(&addr, sizeof(struct in_addr));
bzero(&cfg, sizeof(cfg));
Expand Down Expand Up @@ -226,6 +229,7 @@ int main(int argc, FAR char *argv[])
}
else
{
#ifdef CONFIG_NET_IPv4
if (iperf_args.bind->count > 0)
{
addr.s_addr = inet_addr(iperf_args.bind->sval[0]);
Expand All @@ -248,6 +252,10 @@ int main(int argc, FAR char *argv[])
printf(" IP: %s\n", inet_ntoa_r(addr, inetaddr, sizeof(inetaddr)));

cfg.sip = addr.s_addr;
#else
printf("ERROR: IPv4 Not Enabled\n");
goto out;
#endif
}

if (iperf_args.udp->count == 0)
Expand Down
2 changes: 2 additions & 0 deletions testing/testsuites/kernel/syscall/cmocka_syscall_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ int main(int argc, char *argv[])
test_nuttx_syscall_getpeername01,
test_nuttx_syscall_test_group_setup,
test_nuttx_syscall_test_group_teardown),
# ifdef CONFIG_NET_IPv4
cmocka_unit_test_setup_teardown(
test_nuttx_syscall_getsockopt01,
test_nuttx_syscall_test_group_setup,
Expand All @@ -175,6 +176,7 @@ int main(int argc, char *argv[])
test_nuttx_syscall_setsockopt01,
test_nuttx_syscall_test_group_setup,
test_nuttx_syscall_test_group_teardown),
# endif
cmocka_unit_test_setup_teardown(
test_nuttx_syscall_listen01,
test_nuttx_syscall_test_group_setup,
Expand Down
Loading