From 1ec6038c4883e07087927d4dda9c328cbaf7295d Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 2 Feb 2017 14:56:45 +0200 Subject: samples: net: zperf: Initialize address family properly The IP address family was not set correctly when setting up the connection. This lead to connectivity error in udp.upload command. Change-Id: I598ff2675f97e10e2033763a497f7583c94f3840 Signed-off-by: Jukka Rissanen --- samples/net/zperf/src/zperf_shell.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'samples') diff --git a/samples/net/zperf/src/zperf_shell.c b/samples/net/zperf/src/zperf_shell.c index d3c302dec..f80717fe9 100644 --- a/samples/net/zperf/src/zperf_shell.c +++ b/samples/net/zperf/src/zperf_shell.c @@ -682,11 +682,11 @@ out: static int shell_cmd_upload(int argc, char *argv[]) { + struct sockaddr_in6 ipv6 = { .sin6_family = AF_INET6 }; + struct sockaddr_in ipv4 = { .sin_family = AF_INET }; struct net_context *context6 = NULL, *context4 = NULL; sa_family_t family = AF_UNSPEC; unsigned int duration_in_ms, packet_size, rate_in_kbps; - struct sockaddr_in6 ipv6; - struct sockaddr_in ipv4; uint16_t port; bool is_udp; int start = 0; -- cgit v1.2.3