1 --- iproute2/tc/tc_util.c.orig 2000-04-16 19:42:55.000000000 +0200
2 +++ iproute2/tc/tc_util.c 2004-05-13 10:20:19.438544176 +0200
6 if (strcasecmp(p, "kbps") == 0)
9 else if (strcasecmp(p, "mbps") == 0)
12 else if (strcasecmp(p, "mbit") == 0)
15 else if (strcasecmp(p, "kbit") == 0)
18 else if (strcasecmp(p, "bps") != 0)
23 double tmp = (double)rate*8;
25 - if (tmp >= 1024*1023 && fabs(1024*1024*rint(tmp/(1024*1024)) - tmp) < 1024)
26 - snprintf(buf, len, "%gMbit", rint(tmp/(1024*1024)));
27 - else if (tmp >= 1024-16 && fabs(1024*rint(tmp/1024) - tmp) < 16)
28 - snprintf(buf, len, "%gKbit", rint(tmp/1024));
29 + if (tmp >= 1000*999 && fabs(1000*1000*rint(tmp/(1000*1000)) - tmp) < 1000)
30 + snprintf(buf, len, "%gMbit", rint(tmp/(1000*1000)));
31 + else if (tmp >= 1000-10 && fabs(1000*rint(tmp/1000) - tmp) < 10)
32 + snprintf(buf, len, "%gKbit", rint(tmp/1000));
34 snprintf(buf, len, "%ubps", rate);