timesyncd: avoid signed/unsigned comparison (#7842)

be32toh() returns uint32_t, and m->trans_time.tv_nsec is defined as long in struct timespec.
Let's add a cast to avoid the warning.

Fixes #7789.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2018-01-10 11:35:00 +01:00 committed by Lennart Poettering
parent 05da675a5a
commit edd50d5e24

View file

@ -552,7 +552,7 @@ static int manager_receive_response(sd_event_source *source, int fd, uint32_t re
/* check our "time cookie" (we just stored nanoseconds in the fraction field) */
if (be32toh(ntpmsg.origin_time.sec) != m->trans_time.tv_sec + OFFSET_1900_1970 ||
be32toh(ntpmsg.origin_time.frac) != m->trans_time.tv_nsec) {
be32toh(ntpmsg.origin_time.frac) != (unsigned long) m->trans_time.tv_nsec) {
log_debug("Invalid reply; not our transmit time. Ignoring.");
return 0;
}