diff options
author | Tobias Klauser <tklauser@distanz.ch> | 2015-07-21 09:05:22 +0200 |
---|---|---|
committer | Tobias Klauser <tklauser@distanz.ch> | 2015-07-21 09:05:22 +0200 |
commit | b645a4371c3173fedff7274211b6834195a7ac18 (patch) | |
tree | e5ded5c5786cb0c6a7080d2f78b450514cda0375 | |
parent | f34ce674f3f7aad658fa7c03f37d57a99479052b (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.c | 16 |
1 files changed, 7 insertions, 9 deletions
@@ -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" |