Byte order and rpl problems
This commit is contained in:
parent
c9e8adc414
commit
e2e62596be
@ -672,7 +672,7 @@ void recv_rtr_adv(void)
|
|||||||
ipv6_addr_t abro_addr;
|
ipv6_addr_t abro_addr;
|
||||||
|
|
||||||
ipv6_buf = ipv6_get_buf();
|
ipv6_buf = ipv6_get_buf();
|
||||||
packet_length = IPV6_HDR_LEN + ipv6_buf->length;
|
packet_length = IPV6_HDR_LEN + NTOHS(ipv6_buf->length);
|
||||||
icmpv6_opt_hdr_len = RTR_ADV_LEN;
|
icmpv6_opt_hdr_len = RTR_ADV_LEN;
|
||||||
rtr_adv_buf = get_rtr_adv_buf(ipv6_ext_hdr_len);
|
rtr_adv_buf = get_rtr_adv_buf(ipv6_ext_hdr_len);
|
||||||
ipv6_addr_t newaddr;
|
ipv6_addr_t newaddr;
|
||||||
@ -937,7 +937,7 @@ void recv_nbr_sol(void)
|
|||||||
uint8_t send_na = 0;
|
uint8_t send_na = 0;
|
||||||
uint8_t sllao_set = 0;
|
uint8_t sllao_set = 0;
|
||||||
uint8_t aro_state = NDP_OPT_ARO_STATE_SUCCESS;
|
uint8_t aro_state = NDP_OPT_ARO_STATE_SUCCESS;
|
||||||
uint16_t packet_length = IPV6_HDR_LEN + ipv6_buf->length;
|
uint16_t packet_length = IPV6_HDR_LEN + NTOHS(ipv6_buf->length);
|
||||||
|
|
||||||
/* check whick options are set, we need that because an aro
|
/* check whick options are set, we need that because an aro
|
||||||
* option condition is that a sllao option is set. thus that we don't
|
* option condition is that a sllao option is set. thus that we don't
|
||||||
|
|||||||
@ -1154,7 +1154,7 @@ uint8_t lowpan_iphc_encoding(int if_id, const uint8_t *dest, int dest_len,
|
|||||||
ptr = get_payload_buf(ipv6_ext_hdr_len);
|
ptr = get_payload_buf(ipv6_ext_hdr_len);
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
memcpy(&ipv6_hdr_fields[hdr_pos], &ptr[IPV6_HDR_LEN], ipv6_buf->length);
|
memcpy(&ipv6_hdr_fields[hdr_pos], &ptr[IPV6_HDR_LEN], NTOHS(ipv6_buf->length));
|
||||||
|
|
||||||
comp_len = 2 + hdr_pos + payload_length;
|
comp_len = 2 + hdr_pos + payload_length;
|
||||||
|
|
||||||
|
|||||||
@ -490,7 +490,7 @@ void rpl_process(void)
|
|||||||
code = ((uint8_t *)m_recv.content.ptr);
|
code = ((uint8_t *)m_recv.content.ptr);
|
||||||
/* differentiate packet types */
|
/* differentiate packet types */
|
||||||
ipv6_buf = ipv6_get_buf();
|
ipv6_buf = ipv6_get_buf();
|
||||||
memcpy(&rpl_buffer, ipv6_buf, ipv6_buf->length + IPV6_HDR_LEN);
|
memcpy(&rpl_buffer, ipv6_buf, NTOHS(ipv6_buf->length) + IPV6_HDR_LEN);
|
||||||
|
|
||||||
switch (*code) {
|
switch (*code) {
|
||||||
case (ICMP_CODE_DIS): {
|
case (ICMP_CODE_DIS): {
|
||||||
@ -583,7 +583,7 @@ void recv_rpl_dio(void)
|
|||||||
* ipv6_buf->length contains the packet length minus ipv6 and
|
* ipv6_buf->length contains the packet length minus ipv6 and
|
||||||
* icmpv6 header, so only ICMPV6_HDR_LEN remains to be
|
* icmpv6 header, so only ICMPV6_HDR_LEN remains to be
|
||||||
* subtracted. */
|
* subtracted. */
|
||||||
while (len < (ipv6_buf->length - ICMPV6_HDR_LEN)) {
|
while (len < (NTOHS(ipv6_buf->length) - ICMPV6_HDR_LEN)) {
|
||||||
DEBUG("parsing DIO options\n");
|
DEBUG("parsing DIO options\n");
|
||||||
rpl_opt_buf = get_rpl_opt_buf(len);
|
rpl_opt_buf = get_rpl_opt_buf(len);
|
||||||
|
|
||||||
@ -970,7 +970,7 @@ void rpl_send(ipv6_addr_t *destination, uint8_t *payload, uint16_t p_len, uint8_
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ipv6_send_packet(ipv6_buf);
|
ipv6_send_packet(ipv6_send_buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user