From f61976d9afd9756183d2d02dd6cf35cd4c548c6c Mon Sep 17 00:00:00 2001 From: changtengfei Date: Wed, 1 Jul 2015 17:31:05 +0800 Subject: [PATCH] FW-410. Fixed. --- openstack/02b-MAChigh/neighbors.c | 4 ++++ openstack/03b-IPv6/icmpv6rpl.c | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/openstack/02b-MAChigh/neighbors.c b/openstack/02b-MAChigh/neighbors.c index b97cb448ae..374f8a01cb 100644 --- a/openstack/02b-MAChigh/neighbors.c +++ b/openstack/02b-MAChigh/neighbors.c @@ -435,12 +435,16 @@ The fields which are updated are: */ void neighbors_indicateRxDIO(OpenQueueEntry_t* msg) { uint8_t i; + uint8_t temp_8b; // take ownership over the packet msg->owner = COMPONENT_NEIGHBORS; // update rank of that neighbor in table neighbors_vars.dio = (icmpv6rpl_dio_ht*)(msg->payload); + // retrieve rank + temp_8b = *(msg->payload+2); + neighbors_vars.dio->rank = (temp_8b << 8) + *(msg->payload+3); if (isNeighbor(&(msg->l2_nextORpreviousHop))==TRUE) { for (i=0;il2_nextORpreviousHop),i)) { diff --git a/openstack/03b-IPv6/icmpv6rpl.c b/openstack/03b-IPv6/icmpv6rpl.c index 083c547690..6a1b47c268 100644 --- a/openstack/03b-IPv6/icmpv6rpl.c +++ b/openstack/03b-IPv6/icmpv6rpl.c @@ -346,6 +346,10 @@ void sendDIO() { sizeof(icmpv6rpl_dio_ht) ); + // reverse the rank bytes order in Big Endian + *(msg->payload+2) = (icmpv6rpl_vars.dio.rank >> 8) & 0xFF; + *(msg->payload+3) = icmpv6rpl_vars.dio.rank & 0xFF; + //===== ICMPv6 header packetfunctions_reserveHeaderSize(msg,sizeof(ICMPv6_ht)); ((ICMPv6_ht*)(msg->payload))->type = msg->l4_sourcePortORicmpv6Type;