summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@distanz.ch>2015-07-21 09:05:22 +0200
committerTobias Klauser <tklauser@distanz.ch>2015-07-21 09:05:22 +0200
commitb645a4371c3173fedff7274211b6834195a7ac18 (patch)
treee5ded5c5786cb0c6a7080d2f78b450514cda0375
parentf34ce674f3f7aad658fa7c03f37d57a99479052b (diff)
flowtop: Simplify assignment of flow_entry->is_visible
Just assign a default value of false and override it with true if the checks go through. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
-rw-r--r--flowtop.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/flowtop.c b/flowtop.c
index bf2e585..f0f36c6 100644
--- a/flowtop.c
+++ b/flowtop.c
@@ -936,32 +936,30 @@ static void presenter_screen_update(WINDOW *screen, struct flow_list *fl,
"Is netfilter running?)");
for (; n; n = rcu_dereference(n->next)) {
+ n->is_visible = false;
if (presenter_get_port(n->port_src, n->port_dst, 0) == 53)
- goto skip;
+ continue;
if (presenter_flow_wrong_state(n))
- goto skip;
+ continue;
/* count only flows which might be showed */
flows++;
if (maxy <= 0)
- goto skip;
+ continue;
if (skip_left > 0) {
skip_left--;
- goto skip;
+ continue;
}
+ n->is_visible = true;
+
presenter_screen_do_line(screen, n, &line);
line++;
maxy -= (2 + 1 * show_src);
- n->is_visible = true;
- continue;
-skip:
- n->is_visible = false;
- continue;
}
mvwprintw(screen, 1, 2, "Kernel netfilter flows(%u) for %s%s%s%s%s%s"