unet-cli: strip initial newline in usage message
[project/unetd.git] / network.c
index 0578ad0c70205c4824a978ed2bdf8746065c7dd8..e1ea869d6df560c85e2be462fc8dc18fb3c9de46 100644 (file)
--- a/network.c
+++ b/network.c
@@ -93,8 +93,8 @@ static void network_load_config_data(struct network *net, struct blob_attr *data
                const char *id = blobmsg_get_string(cur);
                siphash_to_le64(&net->net_config.addr.network_id, id, strlen(id), &key);
        } else {
-               siphash_to_le64(&net->net_config.addr.network_id, &net->net_config.port,
-                               sizeof(net->net_config.port), &key);
+               uint32_t port = cpu_to_le32(net->net_config.port);
+               siphash_to_le64(&net->net_config.addr.network_id, &port, sizeof(port), &key);
        }
 
        net->net_config.addr.network_id[0] = 0xfd;