Skip to content

Commit 82b802f

Browse files
Damian-Nordickartben
authored andcommitted
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>
1 parent 87e2030 commit 82b802f

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

subsys/net/lib/zperf/zperf_shell.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -426,6 +426,11 @@ static int cmd_udp_download_stop(const struct shell *sh, size_t argc,
426426
{
427427
int ret;
428428

429+
if (!IS_ENABLED(CONFIG_NET_UDP)) {
430+
shell_warn(sh, "UDP not supported");
431+
return -ENOEXEC;
432+
}
433+
429434
ret = zperf_udp_download_stop();
430435
if (ret < 0) {
431436
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,
14941499
{
14951500
int ret;
14961501

1502+
if (!IS_ENABLED(CONFIG_NET_TCP)) {
1503+
shell_warn(sh, "TCP not supported");
1504+
return -ENOEXEC;
1505+
}
1506+
14971507
ret = zperf_tcp_download_stop();
14981508
if (ret < 0) {
14991509
shell_fprintf(sh, SHELL_WARNING, "TCP server not running!\n");

0 commit comments

Comments
 (0)