1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

gnrc_rpl: Pass options length to msg validator

Currently the length of the full ICMPv6 packet is passed to the
validator function causing validation failures on valid packets. This
fixes that by passing the length of remaining RPL options of the packet.
This commit is contained in:
Koen Zandberg 2018-08-29 00:47:20 +02:00
parent 11f1955ad4
commit af3232fb34
No known key found for this signature in database
GPG Key ID: 0895A893E6D2985B

View File

@ -606,8 +606,9 @@ void gnrc_rpl_recv_DIS(gnrc_rpl_dis_t *dis, kernel_pid_t iface, ipv6_addr_t *src
if (gnrc_rpl_instances[i].state != 0) {
uint32_t included_opts = 0;
size_t opt_len = len - sizeof(gnrc_rpl_dis_t) - sizeof(icmpv6_hdr_t);
if(!_parse_options(GNRC_RPL_ICMPV6_CODE_DIS, &gnrc_rpl_instances[i],
(gnrc_rpl_opt_t *)(dis + 1), len, src, &included_opts)) {
(gnrc_rpl_opt_t *)(dis + 1), opt_len, src, &included_opts)) {
DEBUG("RPL: DIS option parsing error - skip processing the DIS\n");
continue;
}