net: lib: zperf: fix compilation with UDP/TCP only

Fix regression introduced by #88747 that breaks linking
with zperf server enabled but TCP or UDP disabled.

Signed-off-by: Damian Krolik <damian.krolik@nordicsemi.no>
This commit is contained in:
Damian Krolik 2025-05-15 10:43:57 +02:00 committed by Benjamin Cabé
commit 82b802f9ab

View file

@ -426,6 +426,11 @@ static int cmd_udp_download_stop(const struct shell *sh, size_t argc,
{
int ret;
if (!IS_ENABLED(CONFIG_NET_UDP)) {
shell_warn(sh, "UDP not supported");
return -ENOEXEC;
}
ret = zperf_udp_download_stop();
if (ret < 0) {
shell_fprintf(sh, SHELL_WARNING, "UDP server not running!\n");
@ -1494,6 +1499,11 @@ static int cmd_tcp_download_stop(const struct shell *sh, size_t argc,
{
int ret;
if (!IS_ENABLED(CONFIG_NET_TCP)) {
shell_warn(sh, "TCP not supported");
return -ENOEXEC;
}
ret = zperf_tcp_download_stop();
if (ret < 0) {
shell_fprintf(sh, SHELL_WARNING, "TCP server not running!\n");