]> git.ipfire.org Git - thirdparty/mtr.git/commit
net: fix MPLS display for curses and report 390/head
authorVincent Bernat <vincent@bernat.ch>
Tue, 9 Mar 2021 21:46:47 +0000 (22:46 +0100)
committerVincent Bernat <vincent@bernat.ch>
Tue, 9 Mar 2021 21:56:55 +0000 (22:56 +0100)
commitdefd2acfc1b2dc0f548eb50f5a877cc4fb8637e6
treefc3026dcfe104c4bdec356acb165266095860be2
parent1d4babf19c13393ee4c4620bb85e76050023e7f9
net: fix MPLS display for curses and report

After #364, MPLS labels were not displayed anymore due to a logic
invertion. Previously, the addr/mpls fields were populated first and
addrs[i]/mplss[i] copied from these values. After the patch, the
reverse is happening but populating addrs[i] and mpls[i] was still
done by copying the value from addr/mpls. This was not a problem for
displaying addresses as addr was used however for mpls labels, this is
mplss which is used exclusively (net_mpls() is not using mpls field,
but mplss field).

After #364, hosts position is changing depending on the most recent
paths. I didn't fix that as it may be seen as a feature but this can
be a bit disturbing.

Also, unrelated, but the unnecessary/unsafe casts to void pointer are
removed for net_addr(), net_addrs(), net_mpls() and net_mplss(). Also,
net_mpls() is using mpls field instead of mplss as this seems more
correct.

This has been tested with curses and report. Also, raw is still
working.

Fix #370.
ui/net.c
ui/net.h