From: Scott Worley Date: Sun, 8 Oct 2023 04:34:50 +0000 (-0700) Subject: client: net: Fix port byte order X-Git-Tag: v0.1.0~61 X-Git-Url: http://git.scottworley.com/tattlekey/commitdiff_plain/1d94976e09413eba32972b3c60f30e2ee83dbcdb?hp=1e0a316ef9271ddd7e1422883a0a8db771b77a13 client: net: Fix port byte order Docs ( https://www.nongnu.org/lwip/2_0_x/group__udp__raw.html ) say "ipaddr & port are expected to be in the same byte order as in the pcb," which apparently means _don't_ run it through htons(). --- diff --git a/client/net.c b/client/net.c index da33727..c692a12 100644 --- a/client/net.c +++ b/client/net.c @@ -23,7 +23,7 @@ static void initialize_the_pcb() { if (ip4addr_aton(tattle_server_ip_address, &ipaddr) == 0) signal_error_by_blinking(); - if (udp_connect(the_pcb, &ipaddr, htons(tattle_port)) != ERR_OK) + if (udp_connect(the_pcb, &ipaddr, tattle_port) != ERR_OK) signal_error_by_blinking(); }