Skip to content

Commit

Permalink
Merge pull request openwsn-berkeley#198 from openwsn-berkeley/develop…
Browse files Browse the repository at this point in the history
…_FW-410

FW-410. Fixed.
  • Loading branch information
twatteyne committed Jul 1, 2015
2 parents 6b89e72 + f61976d commit ffdda12
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions openstack/02b-MAChigh/neighbors.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;i<MAXNUMNEIGHBORS;i++) {
if (isThisRowMatching(&(msg->l2_nextORpreviousHop),i)) {
Expand Down
4 changes: 4 additions & 0 deletions openstack/03b-IPv6/icmpv6rpl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit ffdda12

Please sign in to comment.