--- rpl/src/instructions_o1.c 2010/04/21 13:45:48 1.12 +++ rpl/src/instructions_o1.c 2010/09/23 15:27:39 1.24 @@ -1,6 +1,6 @@ /* ================================================================================ - RPL/2 (R) version 4.0.15 + RPL/2 (R) version 4.0.20 Copyright (C) 1989-2010 Dr. BERTRAND Joël This file is part of RPL/2. @@ -20,7 +20,7 @@ */ -#include "rpl.conv.h" +#include "rpl-conv.h" /* @@ -934,7 +934,9 @@ instruction_open(struct_processus *s_eta struct sockaddr_un socket_unix; struct sockaddr_in socket_ipv4; +# ifdef IPV6 struct sockaddr_in6 socket_ipv6; +# endif struct_objet *s_objet_argument; struct_objet *s_objet_resultat; @@ -4183,8 +4185,8 @@ instruction_open(struct_processus *s_eta pointeur++; } - strncpy(socket_unix.sun_path, pointeur, 108); - socket_unix.sun_path[108 - 1] = d_code_fin_chaine; + strncpy(socket_unix.sun_path, pointeur, UNIX_PATH_MAX); + socket_unix.sun_path[UNIX_PATH_MAX - 1] = d_code_fin_chaine; if (options_socket() == d_erreur) { @@ -4339,6 +4341,7 @@ instruction_open(struct_processus *s_eta } else { // Accès en IPv6 +# ifdef IPV6 resolution_courante = resolution; while(resolution_courante != NULL) @@ -4436,6 +4439,18 @@ instruction_open(struct_processus *s_eta (*resolution_courante).ai_addr)) .sin6_addr.s6_addr[i]); } +# else + if ((*s_etat_processus).langue == 'F') + { + printf("+++Attention : Support du protocole" + " IPv6 indisponible\n"); + } + else + { + printf("+++Warning : IPv6 support " + "unavailable\n"); + } +# endif } freeaddrinfo(resolution); @@ -4523,6 +4538,7 @@ instruction_open(struct_processus *s_eta } else { // Accès en IPv6 +# ifdef IPV6 if (((*((struct_socket *) (*s_objet_resultat) .objet)).adresse = malloc(55 * sizeof(unsigned char))) == NULL) @@ -4593,6 +4609,18 @@ instruction_open(struct_processus *s_eta d_ex_erreur_acces_fichier; return; } +# else + if ((*s_etat_processus).langue == 'F') + { + printf("+++Attention : Support du protocole" + " IPv6 indisponible\n"); + } + else + { + printf("+++Warning : IPv6 support " + "unavailable\n"); + } +# endif } } @@ -4696,8 +4724,8 @@ instruction_open(struct_processus *s_eta socket_unix.sun_family = AF_UNIX; strncpy(socket_unix.sun_path, (*((struct_socket *) - (*s_objet_resultat).objet)).adresse, 108); - socket_unix.sun_path[108 - 1] = d_code_fin_chaine; + (*s_objet_resultat).objet)).adresse, UNIX_PATH_MAX); + socket_unix.sun_path[UNIX_PATH_MAX - 1] = d_code_fin_chaine; if ((type_socket == 'S') || (type_socket == 'Q')) { @@ -4851,6 +4879,7 @@ instruction_open(struct_processus *s_eta } else { // Accès en IPv6 +# ifdef IPV6 resolution_courante = resolution; while(resolution_courante != NULL) @@ -4950,6 +4979,18 @@ instruction_open(struct_processus *s_eta (*resolution_courante).ai_addr)) .sin6_addr.s6_addr[i]); } +# else + if ((*s_etat_processus).langue == 'F') + { + printf("+++Attention : Support du protocole" + " IPv6 indisponible\n"); + } + else + { + printf("+++Warning : IPv6 support " + "unavailable\n"); + } +# endif } freeaddrinfo(resolution); @@ -5058,6 +5099,7 @@ instruction_open(struct_processus *s_eta } else if (strcmp(protocole, "IPV6") == 0) { // Accès en IPv6 +# ifdef IPV6 if (type_adresse == '6') { if (((*((struct_socket *) (*s_objet_resultat) @@ -5149,6 +5191,18 @@ instruction_open(struct_processus *s_eta (*((struct_socket *) (*s_objet_resultat).objet)) .socket_en_ecoute = 'N'; } +# else + if ((*s_etat_processus).langue == 'F') + { + printf("+++Attention : Support du protocole" + " IPv6 indisponible\n"); + } + else + { + printf("+++Warning : IPv6 support " + "unavailable\n"); + } +# endif } else { // Socket UNIX @@ -5265,6 +5319,8 @@ instruction_open(struct_processus *s_eta (*s_etat_processus).erreur_systeme = d_es_allocation_memoire; return; } + + liberation(s_etat_processus, s_objet_argument); } else {