Commit e7444dcf authored by Maochen Wang's avatar Maochen Wang Committed by Fabio Baltieri
Browse files

net: zperf: Fix TOS option not working in zperf



When the zperf command is called with '-S' option which means IP_TOS
for IPv4 and IPV6_TCLASS for IPv6, an error is printed and the
setting does not work. The socket option handling was changed by
commit 77e522a5('net: context: Refactor option setters'), but the
callers of option setters were not changed. This causes the IP_TOS
or IPV6_TCLASS option failed to set. The fix is to use uint8_t to
store the value of the -S option.

Signed-off-by: default avatarMaochen Wang <maochen.wang@nxp.com>
parent 19a23d51
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -109,7 +109,7 @@ int zperf_get_ipv4_addr(char *host, struct in_addr *addr)
	return 0;
}

int zperf_prepare_upload_sock(const struct sockaddr *peer_addr, int tos,
int zperf_prepare_upload_sock(const struct sockaddr *peer_addr, uint8_t tos,
			      int priority, int proto)
{
	socklen_t addrlen = peer_addr->sa_family == AF_INET6 ?
+1 −1
Original line number Diff line number Diff line
@@ -95,7 +95,7 @@ struct sockaddr_in *zperf_get_sin(void);

extern void connect_ap(char *ssid);

int zperf_prepare_upload_sock(const struct sockaddr *peer_addr, int tos,
int zperf_prepare_upload_sock(const struct sockaddr *peer_addr, uint8_t tos,
			      int priority, int proto);

uint32_t zperf_packet_duration(uint32_t packet_size, uint32_t rate_in_kbps);