]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
Fix overflow in time2tick / tick2time.
authorAndreas Henriksson <andreas@fatal.se>
Fri, 12 Oct 2007 08:56:46 +0000 (10:56 +0200)
committerStephen Hemminger <shemminger@linux-foundation.org>
Fri, 12 Oct 2007 21:56:35 +0000 (14:56 -0700)
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>
tc/tc_core.c
tc/tc_core.h

index 58155fbf7ce2aa75f4b6c7077a14a4db34115c68..fb898766972f704de0d8690f9d5a36448e14445e 100644 (file)
@@ -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;
 }
index a139da6f6652d37d209677aeaff60874b9c147c6..b2a16bc32ffd1b6a1cdbcdd9497aa97e3965e57b 100644 (file)
@@ -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);