1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-27 07:21:18 +01:00

shell_commands/ping6: mix-in current time into ID

This prevents two fast executions of `ping6` behind each other to
confuse their respective responses.
This commit is contained in:
Martine Lenders 2019-07-31 09:49:07 +02:00
parent 699fbc998a
commit 1c7d4572a7

View File

@ -242,8 +242,9 @@ static int _configure(int argc, char **argv, _ping_data_t *data)
if (res != 0) {
_usage(cmdname);
}
data->id ^= (xtimer_now_usec() & UINT16_MAX);
#ifdef MODULE_LUID
luid_custom(&data->id, sizeof(data->id), DEFAULT_ID);
luid_custom(&data->id, sizeof(data->id), data->id);
#endif
return res;
}