Merge branch '16-update_neighbours' of gaufre.informatique.univ-paris-diderot.fr:perdriau/dazibao into 16-update_neighbours

This commit is contained in:
n07070 2020-04-27 18:03:21 +02:00
commit 82948ef639

View File

@ -424,7 +424,7 @@ int send_packet(char *packet_buff, int16_t length, struct sockaddr_in6 *dest, in
((packet*) packet_buff)->length = htons(((packet*) packet_buff)->length);
// Vectorized buffer
struct iovec vec_buff = {.iov_len = length, .iov_base = packet_buff};
struct iovec vec_buff = {.iov_len = length + 4, .iov_base = packet_buff};
int error_while_sending = 0;
@ -458,7 +458,7 @@ int send_packet(char *packet_buff, int16_t length, struct sockaddr_in6 *dest, in
int send_single_tlv(tlv *tlv, struct sockaddr_in6 *dest, int socket_num) {
char type = tlv->pad1->type;
unsigned char len;
packet pack = (packet) {.magic = 95, .version = 1, .length = 4};
packet pack = (packet) {.magic = 95, .version = 1, .length = 0};
memset(pack.body, 0, 1020);
// Copy data from tlv into body
@ -1006,7 +1006,7 @@ int run_node(int sock_fd){
if (bytes > 0) {
printf("Received %i bytes as : %s\n", (int)bytes, output_buffer);
// Treat incoming packets.
int work_tlv_status = listen_for_packets(&output_buffer, bytes, &sender, sock_fd);
int work_tlv_status = listen_for_packets(output_buffer, bytes, &sender, sock_fd);
if (work_tlv_status < 0) {
perror(">> Error while treating the incoming packet.");
}