Skip to content

Commit

Permalink
Merge pull request #3654 from OlegHahm/rpl_scan_findings
Browse files Browse the repository at this point in the history
RPL: clang analyzer findings
  • Loading branch information
OlegHahm committed Aug 18, 2015
2 parents 147bf75 + 687cc6e commit e5d5c37
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions sys/net/routing/ng_rpl/ng_rpl.c
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,9 @@ static void _receive(ng_pktsnip_t *icmpv6)
icmpv6_hdr_t *icmpv6_hdr = NULL;

LL_SEARCH_SCALAR(icmpv6, ipv6, type, NG_NETTYPE_IPV6);

assert(ipv6 != NULL);

ipv6_hdr = (ipv6_hdr_t *)ipv6->data;

icmpv6_hdr = (icmpv6_hdr_t *)icmpv6->data;
Expand Down
4 changes: 3 additions & 1 deletion sys/net/routing/ng_rpl/ng_rpl_control_messages.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ void ng_rpl_send_DIO(ng_rpl_dodag_t *dodag, ipv6_addr_t *destination)
dodag_conf->reserved = 0;
dodag_conf->default_lifetime = dodag->default_lifetime;
dodag_conf->lifetime_unit = byteorder_htons(dodag->lifetime_unit);
pos += sizeof(*dodag_conf);
}

dodag->dodag_conf_counter++;
Expand Down Expand Up @@ -403,6 +402,9 @@ void ng_rpl_recv_DIO(ng_rpl_dio_t *dio, ipv6_addr_t *src, uint16_t len)
trickle_increment_counter(&dodag->trickle);
}

/* ng_rpl_parent_add_by_addr should have set this already */
assert(parent != NULL);

parent->rank = byteorder_ntohs(dio->rank);

if(!_parse_options(NG_RPL_ICMPV6_CODE_DIO, dodag, (ng_rpl_opt_t *)(dio + 1), len, NULL)) {
Expand Down

0 comments on commit e5d5c37

Please sign in to comment.