Fix overflow in time2tick / tick2time.
The helper functions gets passed an unsigned int, which gets cast to long and overflows. See http://bugs.debian.org/175462 Signed-off-by: Andreas Henriksson <andreas@fatal.se> Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
This commit is contained in:
parent
f7c3cefc9c
commit
4475984498
|
|
@ -35,12 +35,12 @@ int tc_core_time2big(long time)
|
|||
}
|
||||
|
||||
|
||||
long tc_core_time2tick(long time)
|
||||
unsigned tc_core_time2tick(unsigned time)
|
||||
{
|
||||
return time*tick_in_usec;
|
||||
}
|
||||
|
||||
long tc_core_tick2time(long tick)
|
||||
unsigned tc_core_tick2time(unsigned tick)
|
||||
{
|
||||
return tick/tick_in_usec;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,8 +7,8 @@
|
|||
#define TIME_UNITS_PER_SEC 1000000
|
||||
|
||||
int tc_core_time2big(long time);
|
||||
long tc_core_time2tick(long time);
|
||||
long tc_core_tick2time(long tick);
|
||||
unsigned tc_core_time2tick(unsigned time);
|
||||
unsigned tc_core_tick2time(unsigned tick);
|
||||
long tc_core_time2ktime(long time);
|
||||
long tc_core_ktime2time(long ktime);
|
||||
unsigned tc_calc_xmittime(unsigned rate, unsigned size);
|
||||
|
|
|
|||
Loading…
Reference in New Issue