From a891a2ffe800488c6dd38e460b218208aa747aa8 Mon Sep 17 00:00:00 2001 From: adamdunkels Date: Wed, 3 Nov 2010 11:56:11 +0000 Subject: [PATCH] Bugfix: allow ICMPv6 to send packets larger than those whose length fits in one byte. Bugfix by mathieupouillot --- core/net/uip-icmp6.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/net/uip-icmp6.c b/core/net/uip-icmp6.c index 0c4066ecc..333686bcd 100644 --- a/core/net/uip-icmp6.c +++ b/core/net/uip-icmp6.c @@ -205,8 +205,8 @@ uip_icmp6_send(uip_ipaddr_t *dest, int type, int code, int payload_len) UIP_IP_BUF->flow = 0; UIP_IP_BUF->proto = UIP_PROTO_ICMP6; UIP_IP_BUF->ttl = uip_ds6_if.cur_hop_limit; - UIP_IP_BUF->len[0] = 0; - UIP_IP_BUF->len[1] = UIP_ICMPH_LEN + payload_len; + UIP_IP_BUF->len[0] = (UIP_ICMPH_LEN + payload_len) >> 8; + UIP_IP_BUF->len[1] = (UIP_ICMPH_LEN + payload_len) & 0xff; memcpy(&UIP_IP_BUF->destipaddr, dest, sizeof(*dest)); uip_ds6_select_src(&UIP_IP_BUF->srcipaddr, &UIP_IP_BUF->destipaddr);