net: mqtt_sn: fix returning address from zsock_recvfrom

The fix in 1264a923f37bce88146674a3c7f93d3886a50669 was incomplete, because
it doesn't initialize the variable. To quote from opengroup [1]:
address_len
    Either a null pointer, if address is a null pointer, or a pointer to a
    socklen_t object which on input specifies the length of the supplied
    sockaddr structure, and on output specifies the length of the stored
    address.

This caused the returned address to be incomplete, because it got truncated
depending on what addrlen_local got initialized with implicitly. This broke
talking to discovered MQTT-SN gateways.

I intend to implement integration tests for the MQTT-SN UDP transport to
prevent such issues in future, but that will be done in a separate PR.

[1] https://pubs.opengroup.org/onlinepubs/9699919799/functions/recvfrom.html

Signed-off-by: Michael Zimmermann <michael.zimmermann@sevenlab.de>
1 file changed