diff --git a/netutils/iperf/iperf.c b/netutils/iperf/iperf.c index cda61f68edc..5635443fd25 100644 --- a/netutils/iperf/iperf.c +++ b/netutils/iperf/iperf.c @@ -220,6 +220,7 @@ 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; @@ -227,6 +228,7 @@ static void iperf_print_addr(FAR const char *str, FAR struct sockaddr *addr) inet_ntoa(inaddr->sin_addr), htons(inaddr->sin_port)); return; } +#endif case AF_LOCAL: { diff --git a/netutils/iperf/iperf_main.c b/netutils/iperf/iperf_main.c index 67ff3855ef0..b87a122bccc 100644 --- a/netutils/iperf/iperf_main.c +++ b/netutils/iperf/iperf_main.c @@ -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)); @@ -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]); @@ -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) diff --git a/testing/testsuites/kernel/syscall/cmocka_syscall_test.c b/testing/testsuites/kernel/syscall/cmocka_syscall_test.c index e1fceb592ba..70b1c592f79 100644 --- a/testing/testsuites/kernel/syscall/cmocka_syscall_test.c +++ b/testing/testsuites/kernel/syscall/cmocka_syscall_test.c @@ -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, @@ -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,