From dee1f2deaa71ae2595c4121500a95f06f8ce1c48 Mon Sep 17 00:00:00 2001 From: Chaitanya Tata Date: Wed, 25 Oct 2023 22:14:26 +0530 Subject: [PATCH] net: zperf: Set default IP addresses only if configured If the user has not configured then we see the error prints for the defaults always. Signed-off-by: Chaitanya Tata --- subsys/net/lib/zperf/zperf_shell.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/subsys/net/lib/zperf/zperf_shell.c b/subsys/net/lib/zperf/zperf_shell.c index 94811721927..a553bb46c8d 100644 --- a/subsys/net/lib/zperf/zperf_shell.c +++ b/subsys/net/lib/zperf/zperf_shell.c @@ -1195,7 +1195,7 @@ void zperf_shell_init(void) { int ret; - if (IS_ENABLED(CONFIG_NET_IPV6) && MY_IP6ADDR) { + if (IS_ENABLED(MY_IP4ADDR_SET) && MY_IP6ADDR) { ret = net_addr_pton(AF_INET6, MY_IP6ADDR, &in6_addr_my.sin6_addr); if (ret < 0) { @@ -1218,7 +1218,7 @@ void zperf_shell_init(void) } } - if (IS_ENABLED(CONFIG_NET_IPV4) && MY_IP4ADDR) { + if (IS_ENABLED(MY_IP4ADDR_SET) && MY_IP4ADDR) { ret = net_addr_pton(AF_INET, MY_IP4ADDR, &in4_addr_my.sin_addr); if (ret < 0) {