1
0
mirror of https://code.semirocket.science/wrapsix synced 2024-11-08 15:21:00 +02:00

Fixed another SIGSEGV

This commit is contained in:
Michal Zima 2012-05-13 21:59:21 +02:00
parent a7f750a3e0
commit 707eb6159b

View File

@ -184,7 +184,7 @@ int udp_ipv6(struct s_ethernet *eth6, struct s_ipv6 *ip6, char *payload)
}
/* allocate memory for translated packet */
packet_size = sizeof(struct s_ipv4) + ip6->len;
packet_size = sizeof(struct s_ipv4) + htons(ip6->len);
if ((packet = (unsigned char *) malloc(packet_size)) == NULL) {
fprintf(stderr, "[Error] Lack of free memory\n");
return 1;