forked from pool/iptraf-ng
28 lines
933 B
Diff
28 lines
933 B
Diff
|
From 96b7a5e17dce341b083ae802501d5c1c1966a0a9 Mon Sep 17 00:00:00 2001
|
||
|
From: Jan Engelhardt <jengelh@inai.de>
|
||
|
Date: Mon, 6 Jan 2020 16:40:58 +0100
|
||
|
Subject: [PATCH] ifstats: make sort-by-ifname the only mode of operation
|
||
|
|
||
|
https://github.com/iptraf-ng/iptraf-ng/pull/2
|
||
|
|
||
|
Signed-off-by: Jan Engelhardt <jengelh@inai.de>
|
||
|
---
|
||
|
src/ifstats.c | 13 +++----------
|
||
|
src/options.c | 50 ++++++++++++++++++++------------------------------
|
||
|
src/options.h | 2 +-
|
||
|
3 files changed, 24 insertions(+), 41 deletions(-)
|
||
|
|
||
|
diff --git a/src/ifstats.c b/src/ifstats.c
|
||
|
index 0ae9b08..f871fc7 100644
|
||
|
--- a/src/ifstats.c
|
||
|
+++ b/src/ifstats.c
|
||
|
@@ -194,7 +194,7 @@ static void initiflist(struct iflist **list)
|
||
|
|
||
|
/* make the linked list sorted by ifindex */
|
||
|
struct iflist *cur = *list, *last = NULL;
|
||
|
- while (cur != NULL && cur->ifindex < ifindex) {
|
||
|
+ while (cur != NULL && strcmp(cur->ifname, ifname) < 0) {
|
||
|
last = cur;
|
||
|
cur = cur->next_entry;
|
||
|
}
|