ret = DNSServiceRegister(sd_ref, local_handle->flags,
reg->if_index, reg->service_name,
local_handle->service_type, local_handle->domain,
- NULL, reg->port, 1, "", __dnssd_register_reply_cb,
+ NULL, htons((unsigned short int)reg->port),
+ 1, "", __dnssd_register_reply_cb,
NULL);
if (ret < 0) {
DNSSD_LOGE("Failed to register for dns service, error[%s]", //LCOV_EXCL_LINE
found->txt_len = txt_len;
}
found->host = g_strdup(host_name);
- found->port = port;
+ found->port = (int)ntohs(port);
DNSSD_LOGD("Create found handle [%u]", local_handle->service_handler);