udhcp: protect agianst timer overflowing 32-bit counter

function                                             old     new   delta
arpping                                              398     387     -11
This commit is contained in:
Denis Vlasenko 2008-05-09 11:55:58 +00:00
parent f3aa4a8ec5
commit b89e2027d9

View File

@ -106,7 +106,7 @@ int arpping(uint32_t test_ip, uint32_t from_ip, uint8_t *from_mac, const char *i
break;
}
}
timeout_ms -= (monotonic_us() - prevTime) / 1000;
timeout_ms -= ((unsigned)monotonic_us() - prevTime) / 1000;
} while (timeout_ms > 0);
ret: