1. 06 Mar, 2016 2 commits
    • Phil Sutter's avatar
      libnetlink: Double the dump buffer size · 72b365e8
      Phil Sutter authored
      There have been reports about 'ip addr' printing "Message truncated" on
      systems with large numbers of VFs. Although I haven't been able to get
      my hands on hardware suitable to reproduce this, increasing the dump
      buffer has been reported to resolve the issue. For want of a better
      idea, just double the buffer size to 32k.
      
      Feels like this opportunistic buffer size selection is rather
      workarounding a design flaw in libnetlink or maybe even the netlink
      protocol itself.
      Signed-off-by: default avatarPhil Sutter <phil@nwl.cc>
      72b365e8
    • Phil Sutter's avatar
      ifstat, nstat: fix daemon mode · dd81ee04
      Phil Sutter authored
      Since the relevant code (and it's bugs) is identical in both files, fix
      them in one go. This patch fixes multiple issues:
      
      * Using 'int' for the 'tdiff' variable does not suffice on 64bit
        systems, the assigned initial time difference makes it wrap and
        contain a negative value afterwards. Instead use the more appropriate
        'time_t' type.
      
      * As far as I understood the code, poll() is supposed to time out just
        at the right time to trigger update_db() in the configured interval.
        Therefore it's timeout must be set to the desired interval *minus* the
        time that has already passed since then.
      
      * With the last change to the algorithm in place, it does not make sense
        to call update_db() before returning data to the connected client.
        Actually, it never does otherwise we could skip the periodic updates
        in the first place.
      Signed-off-by: default avatarPhil Sutter <phil@nwl.cc>
      dd81ee04
  2. 04 Mar, 2016 19 commits
  3. 02 Mar, 2016 19 commits