From 5beecb8cc4fa2b65c433ab294ace28696ac3b927 Mon Sep 17 00:00:00 2001 From: Brandon Ewing Date: Fri, 13 May 2022 10:27:55 -0500 Subject: [PATCH] use addrs for static host ordering in curses Change d2552ca has the side effect of moving hosts around in the multipath view, as the last host to reply to a packet was set as addr. Using addrs[0] istead of addr to draw the first host keeps the ordering deterministic, in order of first reply. --- ui/curses.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ui/curses.c b/ui/curses.c index d01e178..ce66275 100644 --- a/ui/curses.c +++ b/ui/curses.c @@ -421,8 +421,8 @@ static void mtr_curses_hosts( for (at = net_min(ctl) + ctl->display_offset; at < max; at++) { printw("%2d. ", at + 1); err = net_err(at); - addr = net_addr(at); - mpls = net_mpls(at); + addr = net_addrs(at, 0); + mpls = net_mplss(at, 0); addrcmp_result = addrcmp(addr, &ctl->unspec_addr, ctl->af); @@ -471,7 +471,7 @@ static void mtr_curses_hosts( } /* Multi path */ - for (i = 0; i < MAX_PATH; i++) { + for (i = 1; i < MAX_PATH; i++) { addrs = net_addrs(at, i); mplss = net_mplss(at, i); if (addrcmp(addrs, addr, ctl->af) == 0) -- 2.47.2