yvs [Fri, 8 May 2026 13:52:04 +0000 (17:52 +0400)]
split: support more interactive keys
Port the split-mode key handling idea from the mtr085 fork and adapt it to upstream mtr actions. This lets split mode use the same pause, resume, display, compact, MPLS, DNS, and scroll keys that the select loop already supports.
yvs [Fri, 8 May 2026 13:28:05 +0000 (17:28 +0400)]
curses: validate packet size input
Port the interactive packet-size validation from yvs2014/mtr085. The curses s command now validates the newly entered value before assigning it, matching the command-line packet-size range.
yvs [Fri, 8 May 2026 13:26:46 +0000 (17:26 +0400)]
net: use arc4random_uniform when available
Port the arc4random_uniform probe-randomization piece from yvs2014/mtr085. Platforms that provide arc4random_uniform use it for random packet sizes and payload patterns; other platforms keep the existing rand() fallback.
yvs [Fri, 8 May 2026 13:20:38 +0000 (17:20 +0400)]
options: reject invalid bit patterns
Port the bitpattern validation from yvs2014/mtr085. Only -1 selects a random payload pattern; other negative values and values above 255 are rejected instead of silently enabling random mode.
yvs [Fri, 8 May 2026 12:59:36 +0000 (16:59 +0400)]
options: add cache mode for known hops
Port the mtr085 cache mode as a long-only option for current upstream. Upstream already uses -x for XML output, so this keeps the user-facing short-option namespace unchanged and exposes only --cache SECONDS.
yvs [Fri, 8 May 2026 12:55:25 +0000 (16:55 +0400)]
csv: preserve blank output fields
Port the CSV blank-field behavior from yvs2014/mtr085 so an output order spacer produces an empty CSV column instead of reusing the drop counter callback.
Roger Wolff [Sun, 26 Apr 2026 13:38:30 +0000 (15:38 +0200)]
Merge pull request #568 from mayconrcmello/fix/cygwin-braille
ui: fix braille display mode on Cygwin
I would find it neater to add a check for the header that cygwin uses, instead of checking for cygwin and just including that. This involves messing with the autoconf stuff which I'm not familiar with. So that's an item for the "todo list".
Three issues prevented the braille display from rendering correctly
when mtr is built with Cygwin:
1. Wrong ncurses header: Cygwin ships <ncurses.h> as the non-wide
variant, which does not declare addwstr() or add_wch(). Include
<ncursesw/ncurses.h> instead when building with braille support.
2. Wrong output function: printw("%ls", wstr) relies on the C library
wide-to-multibyte conversion path, which can misbehave when the
locale is not fully set up before ncurses initialises. Use
addwstr(), the proper ncursesw API, instead.
3. Locale and console codepage: setlocale(LC_ALL, "") on Cygwin
inherits the Windows ANSI codepage (e.g. CP1252), breaking UTF-8
output. Explicitly request C.UTF-8 and set the Windows console
output codepage to 65001 (UTF-8) before initscr().
ui: replace non-BMP braille char U+1FB10 with U+28FF
🮐 (U+1FB10) lives outside the Basic Multilingual Plane and requires
a UTF-16 surrogate pair when wchar_t is 16 bits (Windows, Cygwin).
Passing a surrogate pair to wide-char ncurses functions produces
corrupted output on those platforms.
Replace all three uses with ⣿ (U+28FF), the filled braille pattern,
which is the visually closest BMP character and avoids the issue on
any platform where sizeof(wchar_t) == 2.
Petr Sumbera [Thu, 19 Mar 2026 09:34:32 +0000 (10:34 +0100)]
packet: skip bind() on Solaris raw ICMPv4 sockets
Commit d529dbeefc6d ("Change UDP and ICMP sockets binding to accept a
source IP from the -a CLI option") started binding the shared IPv4 raw
ICMP send socket in construct_ip4_packet().
On Solaris/illumos this breaks default ICMP probes: bind() on that raw
socket can fail with EINVAL, and mtr exits with:
mtr: mtr-packet reported invalid argument
This does not affect TCP or UDP probes, and mtr 0.95 worked because the
raw ICMPv4 path did not bind the socket.
Keep the pre-0.96 behavior on __sun by skipping bind() for raw ICMPv4
sockets. This restores default ICMP probing on Solaris/illumos without
changing Linux behavior.
Note that -a source address selection is not enforced for raw ICMPv4 on
Solaris/illumos, since those platforms cannot reliably use bind() on the
shared raw ICMP socket in this code path.
bluPhy [Sat, 24 Jan 2026 05:10:35 +0000 (00:10 -0500)]
Fix typos in comments and docstrings across codebase
Corrected several spelling errors such as 'unparseable' to 'unparsable', 'paramters' to 'parameters', 'virutal' to 'virtual', 'withing' to 'within', and 'non-existant' to 'non-existent' in both source and test files to improve code clarity and documentation accuracy.