should be completely fixed now
authorxchaos <xchaos@251d49ef-1d17-4917-a970-b30cf55b089b>
Thu, 24 Jan 2013 16:46:22 +0000 (16:46 +0000)
committerxchaos <xchaos@251d49ef-1d17-4917-a970-b30cf55b089b>
Thu, 24 Jan 2013 16:46:22 +0000 (16:46 +0000)
git-svn-id: https://dev.arachne.cz/repos/prometheus/trunk@219 251d49ef-1d17-4917-a970-b30cf55b089b

htmlandlogs.c

index 0443c7b..291871e 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.153948 seconds and 4 git commands to generate.