]> granicus.if.org Git - vnstat/commitdiff
changes in interface specific detected bandwidth limits are reported in the log
authorTeemu Toivola <git@humdi.net>
Mon, 15 Apr 2019 15:16:42 +0000 (18:16 +0300)
committerTeemu Toivola <git@humdi.net>
Mon, 15 Apr 2019 15:16:42 +0000 (18:16 +0300)
CHANGES
src/ibw.c

diff --git a/CHANGES b/CHANGES
index 3d058db9d73ad182553221ce77faf237f7aba613..c9e130afa3b9d36f056b075cc4706d1b7baa4412 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -9,6 +9,8 @@
    - Possibility in queries to merge data from multiple interfaces to one
      output with interface1+interface2 syntax
    - Highlight current day in top list when visible
+   - Changes in interface specific detected bandwidth limits are reported
+     in the log
 
 
 2.1 / 6-Dec-2018
index d33fd74bb3b0bdd1687b3f34f478bc2e10756ce3..280ce249d7d6c64c74bf3567599aedd908a14b3e 100644 (file)
--- a/src/ibw.c
+++ b/src/ibw.c
@@ -111,6 +111,10 @@ int ibwget(const char *iface, uint32_t *limit)
                                if (cfg.bwdetectioninterval > 0 && (current - p->detected) > (cfg.bwdetectioninterval * 60)) {
                                        speed = getifspeed(iface);
                                        if (speed > 0) {
+                                               if (p->detected > 0 && speed != p->limit) {
+                                                       snprintf(errorstring, 1024, "Detected bandwidth limit for \"%s\" changed from %" PRIu32 " Mbit to %" PRIu32 " Mbit.", iface, p->limit, speed);
+                                                       printe(PT_Info);
+                                               }
                                                p->limit = speed;
                                                p->retries = 0;
                                                p->detected = current;