should be completely fixed now
[svn/Prometheus-QoS/.git] / htmlandlogs.c
index 0443c7b94085e7c3b40626a539506e309ea8e1ce..291871ef36177b0bdb02505d10789195b79dd6df 100644 (file)
@@ -327,28 +327,27 @@ void write_htmlandlogs(char *html, char *d, int total, int just_preview)
              limit_count, prio_count);\r
 \r
   if(ip6prefix)\r
-  {\r
\r
+  { \r
    for_each(ip, ips)\r
    { \r
     if(ip->v6)\r
     {\r
-     bytes6 += ip->traffic;\r
-     pkts6 += ip->pktsdown+ip->pktsup;\r
+     bytes6 += ip->upload + ip->direct;\r
+     pkts6 += ip->pktsdown + ip->pktsup;\r
      count6++;\r
     }\r
     else\r
     {\r
-     bytes4 += ip->traffic;\r
-     pkts4 += ip->pktsdown+ip->pktsup;\r
+     bytes4 += ip->upload + ip->direct;\r
+     pkts4 += ip->pktsdown + ip->pktsup;\r
      count4++;\r
     }\r
    }\r
-   perc6=(double)(100*bytes6)/(bytes4+bytes6);\r
 \r
+   perc6=(double)(bytes6)/(bytes4+bytes6)*100;\r
    fputs("<p><table class=\"decorated last\"><caption>IP protocols usage</caption>\n",f);\r
    fprintf(f, "%s<td>Total %d IPv4 (addreses)</td><td style=\"text-align: right\">%Lu MB (%.2f %%)</td><td style=\"text-align: right\">%Lu packets (%.2f %%)</td></tr>\n",\r
-              tr_odd_even(), count4, bytes4, (double)(100*bytes4)/(bytes4+bytes6), pkts4, (float)(100*pkts4)/(pkts4+pkts6));\r
+              tr_odd_even(), count4, bytes4, (double)(bytes4)/(bytes4+bytes6)*100, pkts4, (float)(100*pkts4)/(pkts4+pkts6));\r
    fprintf(f, "%s<td>Total %d IPv6 (/64 ranges)</td><td style=\"text-align: right\">%Lu MB (%.2f %%)</td><td style=\"text-align: right\">%Lu packets (%.2f %%)</td></tr>\n",\r
               tr_odd_even(), count6, bytes6, perc6, pkts6, (float)(100*pkts6)/(pkts4+pkts6));\r
    fputs("</table></p>\n", f);\r
This page took 0.127421 seconds and 4 git commands to generate.