--- 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; else if (strcasecmp(p, "gibit") == 0) bps *= 1024*1024*1024/8; else if (strcasecmp(p, "kbps") == 0) - bps *= 1024; + bps *= 1000; else if (strcasecmp(p, "mbps") == 0) - bps *= 1024*1024; + bps *= 1000*1000; else if (strcasecmp(p, "gbps") == 0) - bps *= 1024*1024*1024; + bps *= 1000*1000*1000; 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);