Merge remote-tracking branch 'origin/master'

This commit is contained in:
SeekDaSky 2017-04-26 22:56:54 +02:00
commit 5d2f912738
1 changed files with 6 additions and 6 deletions

View File

@ -50,8 +50,8 @@ int multicastTerminal(struct middleware_arg* arg){
=========================================================*/ =========================================================*/
/* 1. On parse la requête */ /* 1. On parse la requête */
memcpy(&request.flags, buffer, sizeof(char)); memcpy(&request.flags, buffer, sizeof(char));
memcpy(&request.addr, buffer+sizeof(char), sizeof(char)*15); memcpy(&request.addr, buffer+sizeof(char), sizeof(in_addr_t));
memcpy(&request.port, buffer+sizeof(char)*16, sizeof(unsigned short)); memcpy(&request.port, buffer+sizeof(char)+sizeof(in_addr_t), sizeof(unsigned short));
printf("{%s} received: bind_header{flag = %d; addr = %x; port = %d}\n", arg->entity, (int) request.flags, ntohl(request.addr), request. port); printf("{%s} received: bind_header{flag = %d; addr = %x; port = %d}\n", arg->entity, (int) request.flags, ntohl(request.addr), request. port);
/* 2. Si mauvais flag (avion) */ /* 2. Si mauvais flag (avion) */
@ -119,7 +119,7 @@ int multicastTerminal(struct middleware_arg* arg){
bzero(buffer, MAX_BUF_LEN*sizeof(char)); bzero(buffer, MAX_BUF_LEN*sizeof(char));
memcpy(buffer, &request.flags, sizeof(char)); memcpy(buffer, &request.flags, sizeof(char));
memcpy(buffer+sizeof(char), &request.addr, sizeof(in_addr_t)); memcpy(buffer+sizeof(char), &request.addr, sizeof(in_addr_t));
memcpy(buffer+sizeof(char)*16, &request.port, sizeof(unsigned short)); memcpy(buffer+sizeof(char)+sizeof(in_addr_t), &request.port, sizeof(unsigned short));
/* 2. On envoie la réponse*/ /* 2. On envoie la réponse*/
len = sizeof(struct sockaddr_in); len = sizeof(struct sockaddr_in);