node state request fix
This commit is contained in:
parent
e5ec8b36ae
commit
bdec3db1c6
@ -467,6 +467,7 @@ int add_tlv(packet *pack, tlv *tlv, struct sockaddr_in6 *dest, int socket_num) {
|
|||||||
case 7:
|
case 7:
|
||||||
memcpy(pack->body + pack->length, (char*) &tlv->node_state_req->type, 1);
|
memcpy(pack->body + pack->length, (char*) &tlv->node_state_req->type, 1);
|
||||||
memcpy(pack->body + pack->length + 1, (char*) &tlv->node_state_req->length, 1);
|
memcpy(pack->body + pack->length + 1, (char*) &tlv->node_state_req->length, 1);
|
||||||
|
memcpy(pack->body + pack->length + 2, (char*) &tlv->node_state_req->node_id, 8);
|
||||||
|
|
||||||
pack->length += len;
|
pack->length += len;
|
||||||
|
|
||||||
@ -600,6 +601,7 @@ int send_single_tlv(tlv *tlv, struct sockaddr_in6 *dest, int socket_num) {
|
|||||||
case 7:
|
case 7:
|
||||||
memcpy(pack.body + pack.length, (char*) &tlv->node_state_req->type, 1);
|
memcpy(pack.body + pack.length, (char*) &tlv->node_state_req->type, 1);
|
||||||
memcpy(pack.body + pack.length + 1, (char*) &tlv->node_state_req->length, 1);
|
memcpy(pack.body + pack.length + 1, (char*) &tlv->node_state_req->length, 1);
|
||||||
|
memcpy(pack.body + pack.length + 2, (char*) &tlv->node_state_req->node_id, 8);
|
||||||
|
|
||||||
pack.length += tlv->node_state_req->length + 2;
|
pack.length += tlv->node_state_req->length + 2;
|
||||||
|
|
||||||
@ -1087,7 +1089,6 @@ int work_with_tlvs(char * data, uint16_t total_packet_len, struct sockaddr_in6 *
|
|||||||
add_tlv(&pack, &new_tlv, sender, socket_num);
|
add_tlv(&pack, &new_tlv, sender, socket_num);
|
||||||
} else {
|
} else {
|
||||||
print_debug(">> Found no data for the requested node, skipping...");
|
print_debug(">> Found no data for the requested node, skipping...");
|
||||||
printf("Skipped TLV:\nType: %d\nLength: %d\nNode ID: %lu\n", data[pos], data[pos+1], be64toh(*id));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// The position is updated
|
// The position is updated
|
||||||
@ -1252,6 +1253,7 @@ int work_with_tlvs(char * data, uint16_t total_packet_len, struct sockaddr_in6 *
|
|||||||
send_packet((char*) &pack, pack.length, sender, socket_num);
|
send_packet((char*) &pack, pack.length, sender, socket_num);
|
||||||
}
|
}
|
||||||
print_data(data_list);
|
print_data(data_list);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user