]> git.pld-linux.org Git - packages/iproute2.git/commitdiff
- think
authorJakub Bogusz <qboosh@pld-linux.org>
Wed, 4 Aug 2004 19:05:37 +0000 (19:05 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    iproute2-rates-1024-fix.patch -> 1.3

iproute2-rates-1024-fix.patch

index 877beff67f167004b7ce413fc2a45212b0d8b64b..89dfd0b7db4391524b5f85cddbb6bd59d7f98d0b 100644 (file)
@@ -1,14 +1,6 @@
 --- iproute2-2.6.8/tc/tc_util.c        2004-07-02 17:53:03.000000000 +0000
 +++ iproute2-2.6.8.new/tc/tc_util.c    2004-07-25 17:40:46.427882688 +0000
-@@ -119,17 +119,17 @@
-       else if (strcasecmp(p, "gbit") == 0)
-               bps = (bps * 1000000000.)/8;
-       else if (strcasecmp(p, "kibit") == 0)
--              bps *= 1024 / 8;
-+              bps *= 1000 / 8;
-       else if (strcasecmp(p, "mibit") == 0)
--              bps *= 1024*1024/8;
-+              bps *= 1000*1000/8;
+@@ -125,11 +125,11 @@
        else if (strcasecmp(p, "gibit") == 0)
                bps *= 1024*1024*1024/8;
        else if (strcasecmp(p, "kbps") == 0)
        else if (strcasecmp(p, "bps") != 0)
                return -1;
  
-@@ -172,11 +172,11 @@
-       extern int use_iec;
-       if (use_iec) {
--              if (tmp >= 1024*1023 && 
--                  fabs(1024*1024*rint(tmp/(1024*1024)) - tmp) < 1024)
--                      snprintf(buf, len, "%gMibps", rint(tmp/(1024*1024)));
--              else if (tmp >= 1024-16 && fabs(1024*rint(tmp/1024) - tmp) < 16)
--                      snprintf(buf, len, "%gKibps", rint(tmp/1024));
-+              if (tmp >= 1000*999 && 
-+                  fabs(1000*1000*rint(tmp/(1000*1000)) - tmp) < 1000)
-+                      snprintf(buf, len, "%gMibps", rint(tmp/(1000*1000)));
-+              else if (tmp >= 1000-10 && fabs(1024*rint(tmp/1000) - tmp) < 10)
-+                      snprintf(buf, len, "%gKibps", rint(tmp/1000));
-               else
-                       snprintf(buf, len, "%ubps", rate);
This page took 0.171447 seconds and 4 git commands to generate.