Commit d82aab8f authored by Josh Kunz's avatar Josh Kunz

Fix byte ordering of ip addresses (to be network byte ordered)

parent e8fae19e
......@@ -158,9 +158,7 @@ int cn_dispatch_result_item_init_info(cn_dispatch_result_item_t *item,
return -1;
}
uint32_t ipv4_nbo = *((uint32_t *) ipv4);
ipv4_nbo = htonl(ipv4_nbo);
memcpy(item->info.ipv4, &ipv4_nbo, sizeof(ipv4_nbo));
memcpy(item->info.ipv4, ipv4, sizeof(item->info.ipv4));
memcpy(item->info.mac, mac, sizeof(item->info.mac));
item->info.id = id != NULL ? strdup(id) : NULL;
item->info.domain = domainid != NULL ? strdup(domainid) : NULL;
......@@ -295,6 +293,8 @@ static int __cn_dispatch_result_fill_item(cn_dispatch_result_item_t *item,
reply_info->id = item->info.id;
reply_info->domain = item->info.domain;
reply_info->owner = item->info.owner;
cncinfo("Filling reply with id:%s domain:%s owner:%s\n",
item->info.id, item->info.domain, item->info.owner);
reply_item->result_node_info = reply_info;
}
break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment