On Mon, 18. Nov 16:03 Paul Warren pdw@ex-parrot.com wrote: [...]
On 13/11/2013 11:05, Markus Koschany wrote:
- iftop does not notice changes to ppp interfaces and stops refreshing its output http://bugs.debian.org/543138
Does anyone know how to detect when this happens? It's obviously not treated as an error by pcap_loop() when it happens.
Unfortunately no. Perhaps there are some hints in ifconfig's source code. I could also imagine some buffer that stores the amount of captured packages. If the amount equals zero in a given time frame, one may assume that the device is down and a restart of iftop's capture process necessary. This could be a special option or mode, so that people have to choose it explicitly.
- iftop: chooses eth0 as the default interface instead of the default route http://bugs.debian.org/644998
The code could be changed in two ways:
- Only consider interfaces with routes associated with them.
- Prefer the interface with a default route to other ones.
This is a great idea, but what's the easiest way to identify these interfaces programmatically?
Perhaps you could use a command like
ip route show 0.0.0.0/0
The last output argument is the device with the default route associated to it.
An alternative might be to display all available interfaces at startup and let the user choose the interface herself. (only a small improvement over the -i option but this should definitely work)
Regards,
Markus