Skip to content

Commit

Permalink
net: mqtt-sn: fix port in mqtt-sn debug message
Browse files Browse the repository at this point in the history
The port we are connecting to is stored in network byte order,
thus, we need to convert it to the CPU's byte order before logging

Signed-off-by: Mark Oude Elberink <[email protected]>
  • Loading branch information
markxoe authored and nashif committed Jun 6, 2023
1 parent fdde5bd commit 67dd584
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion subsys/net/lib/mqtt_sn/mqtt_sn_transport_udp.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ static int tp_udp_init(struct mqtt_sn_transport *transport)
out = get_ip_str((struct sockaddr *)&udp->gwaddr, ip, sizeof(ip));
if (out != NULL) {
LOG_DBG("Connecting to IP %s:%u", out,
((struct sockaddr_in *)&udp->gwaddr)->sin_port);
ntohs(((struct sockaddr_in *)&udp->gwaddr)->sin_port));
}
#endif

Expand Down

0 comments on commit 67dd584

Please sign in to comment.