shell_commands: check ICMPv6 echo reply sender

Fixes #11519 by checking the source address when an echo reply is
received by the `ping6` command.
This commit is contained in:
Martine S. Lenders 2019-07-30 12:40:07 +02:00
parent 6e9612f1d1
commit 4a723fe4fd

View File

@ -338,7 +338,8 @@ static void _print_reply(_ping_data_t *data, gnrc_pktsnip_t *icmpv6,
uint16_t recv_seq; uint16_t recv_seq;
/* not our ping */ /* not our ping */
if (byteorder_ntohs(icmpv6_hdr->id) != data->id) { if ((byteorder_ntohs(icmpv6_hdr->id) != data->id) &&
!ipv6_addr_equal(from, &data->host)) {
return; return;
} }
recv_seq = byteorder_ntohs(icmpv6_hdr->seq); recv_seq = byteorder_ntohs(icmpv6_hdr->seq);