Fix the maxRankIncrease and minHopRankIncrease bytes order.
@@ -530,7 +530,14 @@ void icmpv6rpl_indicateRxDIO(OpenQueueEntry_t* msg) {
case RPL_OPTION_CONFIG:
// configuration option
icmpv6rpl_vars.incomingConf = (icmpv6rpl_config_ht*)(current);
+
+ icmpv6rpl_vars.incomingConf->maxRankIncrease = (icmpv6rpl_vars.incomingConf->maxRankIncrease << 8) | (icmpv6rpl_vars.incomingConf->maxRankIncrease >>8); // 2048
+ icmpv6rpl_vars.incomingConf->minHopRankIncrease = (icmpv6rpl_vars.incomingConf->minHopRankIncrease << 8) | (icmpv6rpl_vars.incomingConf->minHopRankIncrease >>8); //256
+ icmpv6rpl_vars.incomingConf->OCP = (icmpv6rpl_vars.incomingConf->OCP << 8) | (icmpv6rpl_vars.incomingConf->OCP >>8); // 0 OF0
+ icmpv6rpl_vars.incomingConf->lifetimeUnit = (icmpv6rpl_vars.incomingConf->lifetimeUnit << 8) | (icmpv6rpl_vars.incomingConf->lifetimeUnit >>8); // 0xffff
+
memcpy(&icmpv6rpl_vars.conf,icmpv6rpl_vars.incomingConf, sizeof(icmpv6rpl_config_ht));
+
// do whatever needs to be done with the configuration option of RPL
optionsLen = optionsLen - current[1] - 2;
current = current + current[1] + 2;
@@ -687,11 +694,16 @@ void sendDIO(void) {
//copy the PIO in the packet
memcpy(
- ((icmpv6rpl_pio_t*)(msg->payload)),
+ ((icmpv6rpl_config_ht*)(msg->payload)),
&(icmpv6rpl_vars.conf),
sizeof(icmpv6rpl_config_ht)
);
+ ((icmpv6rpl_config_ht*)(msg->payload))->maxRankIncrease = (icmpv6rpl_vars.conf.maxRankIncrease << 8) | (icmpv6rpl_vars.conf.maxRankIncrease >>8); // 2048
+ ((icmpv6rpl_config_ht*)(msg->payload))->minHopRankIncrease = (icmpv6rpl_vars.conf.minHopRankIncrease << 8) | (icmpv6rpl_vars.conf.minHopRankIncrease >>8); //256
+ ((icmpv6rpl_config_ht*)(msg->payload))->OCP = (icmpv6rpl_vars.conf.OCP << 8) | (icmpv6rpl_vars.conf.OCP >>8); // 0 OF0
+ ((icmpv6rpl_config_ht*)(msg->payload))->lifetimeUnit = (icmpv6rpl_vars.conf.lifetimeUnit << 8) | (icmpv6rpl_vars.conf.lifetimeUnit >>8); // 0xffff
+
//===== PIO payload
packetfunctions_reserveHeaderSize(msg,sizeof(icmpv6rpl_pio_t));
