diff options
author | Paul Warren <pdw@ex-parrot.com> | 2017-03-22 09:11:22 +0000 |
---|---|---|
committer | Paul Warren <pdw@ex-parrot.com> | 2017-03-22 09:11:22 +0000 |
commit | 949ed0f7e2c54c598868c270b82c2d702131a339 (patch) | |
tree | 34064dbbd0696dc2eca1f9b40b07e1a1860dded5 | |
parent | 35af3cf65f17961d173b31fd3b00166ec095c226 (diff) | |
download | iftop-949ed0f7e2c54c598868c270b82c2d702131a339.zip |
Choose first running interface, rather than first "up" interface (Redhat #1403025)
Robert Scheck <robert@fedoraproject.org>
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | options.c | 2 |
2 files changed, 4 insertions, 1 deletions
@@ -6,6 +6,9 @@ Unattributed items are by Paul Warren and Chris Lightfoot. 1.0 +* Choose first running interface, rather than first "up" interface (Redhat #1403025) + Robert Scheck <robert@fedoraproject.org> + * Support for unlimited number of lines of output for text mode Roman Hoog Antink <rha@open.ch> @@ -110,7 +110,7 @@ static char *get_first_interface(void) { while(nameindex[j].if_index != 0) { if (strcmp(nameindex[j].if_name, "lo") != 0 && !is_bad_interface_name(nameindex[j].if_name)) { strncpy(ifr.ifr_name, nameindex[j].if_name, sizeof(ifr.ifr_name)); - if ((s == -1) || (ioctl(s, SIOCGIFFLAGS, &ifr) == -1) || (ifr.ifr_flags & IFF_UP)) { + if ((s == -1) || (ioctl(s, SIOCGIFFLAGS, &ifr) == -1) || (ifr.ifr_flags & IFF_RUNNING)) { i = xstrdup(nameindex[j].if_name); break; } |