RADIUS DAS: Avoid compiler warning on abs()

The input parameter ended up being converted to long int instead of int,
so use an explicit typecase to get rid of the compiler warning.

Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
Jouni Malinen 2015-07-07 12:14:47 +03:00
parent 597e8afeb4
commit 028b19675d

View file

@ -245,7 +245,7 @@ static void radius_das_receive(int sock, void *eloop_ctx, void *sock_ctx)
(u8 *) &val, 4); (u8 *) &val, 4);
if (res == 4) { if (res == 4) {
u32 timestamp = ntohl(val); u32 timestamp = ntohl(val);
if ((unsigned int) abs(now.sec - timestamp) > if ((unsigned int) abs((int) (now.sec - timestamp)) >
das->time_window) { das->time_window) {
wpa_printf(MSG_DEBUG, "DAS: Unacceptable " wpa_printf(MSG_DEBUG, "DAS: Unacceptable "
"Event-Timestamp (%u; local time %u) in " "Event-Timestamp (%u; local time %u) in "