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 <Chaitanya.Tata@nordicsemi.no>
This commit is contained in:
Chaitanya Tata 2023-10-25 22:14:26 +05:30 committed by Carles Cufí
parent 6bd47ffb10
commit dee1f2deaa

View File

@ -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) {