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

Include propagation of payload size for ICMPv6 too

This commit is contained in:
xHire 2017-10-21 10:46:44 +02:00
parent f7b98c4da1
commit 24c3cdcf6f
2 changed files with 5 additions and 5 deletions

View File

@ -351,11 +351,13 @@ int icmp_ipv4(struct s_ethernet *eth4, struct s_ipv4 *ip4, char *payload,
* @param eth6 Ethernet header
* @param ip6 IPv6 header
* @param payload ICMPv6 data
* @param payload_size Size of the data payload
*
* @return 0 for success
* @return 1 for failure
*/
int icmp_ipv6(struct s_ethernet *eth6, struct s_ipv6 *ip6, char *payload)
int icmp_ipv6(struct s_ethernet *eth6, struct s_ipv6 *ip6, char *payload,
unsigned short payload_size)
{
struct s_icmp *icmp;
unsigned int *icmp_extra;
@ -364,7 +366,6 @@ int icmp_ipv6(struct s_ethernet *eth6, struct s_ipv6 *ip6, char *payload)
char *icmp_data;
struct s_nat *connection;
unsigned short orig_checksum;
unsigned short payload_size;
char packet[PACKET_BUFFER - sizeof(struct s_ethernet)];
unsigned short new_len = sizeof(struct s_ipv4);
@ -372,8 +373,6 @@ int icmp_ipv6(struct s_ethernet *eth6, struct s_ipv6 *ip6, char *payload)
struct s_ipv4 *ip4;
struct s_ipv6 *eip6;
payload_size = ntohs(ip6->len);
/* sanity check */
if (payload_size < sizeof(struct s_icmp) + 4) {
log_debug("Too short ICMPv6 packet");

View File

@ -79,7 +79,8 @@ struct s_icmp_ndp_na {
int icmp_ipv4(struct s_ethernet *eth, struct s_ipv4 *ip4, char *payload,
unsigned short payload_size);
int icmp_ipv6(struct s_ethernet *eth, struct s_ipv6 *ip6, char *payload);
int icmp_ipv6(struct s_ethernet *eth6, struct s_ipv6 *ip6, char *payload,
unsigned short payload_size);
int icmp_ndp(struct s_ethernet *ethq, struct s_ipv6 *ipq,
struct s_icmp_ndp_ns *ndp_ns);