Commit Graph

794 Commits

Author SHA1 Message Date
R.E. Wolff
b8bceec6c1 proposed patch for bsd compile error 2020-01-06 12:21:22 +01:00
R.E. Wolff
8bf82ec600 net find local address fix by meingtsla 2019-12-31 11:54:01 +01:00
Roger Wolff
c50c1503f4
Merge pull request #325 from kbucheli/tun_interface_segfault
fix segmentation fault if there is no IP address on an interface (fixes #320)
2019-12-06 10:16:53 +01:00
Konrad Bucheli
e6d456fba6 fix segmentation fault if there is no IP address on an interface (fixes #320) 2019-12-06 10:06:38 +01:00
Roger Wolff
3bb66792d1
Merge pull request #322 from commonism/cleanups
sockaddr related cleanups
2019-10-10 11:54:15 +02:00
Markus Kötter
283dc75726 simplification - improve readability 2019-08-14 13:43:53 +02:00
Markus Kötter
3ee915e882 simplification - address addrcmp 2019-08-14 13:41:41 +02:00
Roger Wolff
64d0b7176a
Merge pull request #319 from krisl/fix/stack_use_after_scope
Fix/stack use after scope
2019-08-10 02:23:20 +02:00
Aaron Lipinski
374f9b1db2 avoid stack use after scope 2019-08-10 08:57:14 +12:00
Aaron Lipinski
6e5e81f8dd introduce libasan 2019-08-10 08:57:14 +12:00
Roger Wolff
738b53f683
Merge pull request #310 from krisl/fix/raw_dns
Fix/raw dns
2019-08-09 10:14:27 +02:00
Rogier Wolff
a23e7f1793 in hindsight my previous patch wasn't so nice. And nobody told me. 2019-08-09 08:59:39 +02:00
Markus Kötter
be49b34c8a simplification - remove rsa{4,6} 2019-08-08 12:18:58 +02:00
Markus Kötter
eef2ed0985 simplification - remove addrcpy 2019-08-08 11:50:11 +02:00
Aaron Lipinski
c938dc7725 rely on final return NULL 2019-08-08 21:38:57 +12:00
Aaron Lipinski
fab26eacaf show resolved hostname in raw dnsline 2019-08-08 21:38:57 +12:00
Rogier Wolff
6f92c00e25 Merge branch 'master' of github.com:traviscross/mtr 2019-08-08 11:23:29 +02:00
Roger Wolff
4aec9d69ae make the code for gtk2/3 a bit nicer. 2019-08-08 11:21:45 +02:00
Rogier Wolff
54e8e068b6 Merge branch 'gtk3_with_fallback' of https://github.com/krisl/mtr 2019-08-08 11:13:53 +02:00
Markus Kötter
42fd1d9ac6 simplification - remove sockaddrtop 2019-08-08 11:07:37 +02:00
R.E. Wolff
82527c4af2 Merge branch 'master' of github.com:traviscross/mtr 2019-08-08 10:47:59 +02:00
R.E. Wolff
919422d1de fix warning on recent compilers. 2019-08-08 10:47:44 +02:00
Aaron Lipinski
2efd893f7c gtk_menu_popup -> gtk_menu_popup_at_pointer 2019-08-08 20:40:47 +12:00
Aaron Lipinski
743ea4b76c hbox/vbox -> gtk_box_new 2019-08-08 20:40:47 +12:00
Aaron Lipinski
5bd8e6c3ba gtk3 2019-08-08 20:40:47 +12:00
Aaron Lipinski
e5c5e9a7da gtk_button_new_from_stock -> gtk_button_new_with_label 2019-08-08 15:15:30 +12:00
Aaron Lipinski
48ae4f83ca GTK_OBJECT -> G_OBJECT 2019-08-08 15:11:22 +12:00
Aaron Lipinski
c50fac8cbd gtk_menu_append -> gtk_menu_shell_append 2019-08-08 15:11:22 +12:00
Roger Wolff
4d9f3e84c5
Merge pull request #166 from meingtsla/asn-open-always-hcreate
Fix repeated DNS queries when toggling ipinfo
2019-08-07 09:51:53 +02:00
Roger Wolff
a60f108528
Merge pull request #315 from lembacon/find_source_addr
probe: fix find_source_addr
2019-08-06 18:24:27 +02:00
Chongyu Zhu
9fe183d61f
probe: fix find_source_addr 2019-08-06 23:01:57 +08:00
R.E. Wolff
304349bad8 The release script bumped the version number to 0.93 2019-08-03 10:31:26 +02:00
Roger Wolff
9fed81ee89
Merge pull request #274 from commonism/udp_checksum
udp checksum is incorrect
2019-07-28 16:46:02 +02:00
Markus Kötter
3e2b0bd38e construct - fix set port
- introducing sockaddr_port_offset broke setting a port
2019-07-24 08:32:34 +02:00
Rogier Wolff
facd224790 Added parentheses 2019-07-17 23:22:39 +02:00
Roger Wolff
43b79d68f9
Merge pull request #306 from kerolasa/eaddrnotavail
mtr-packet: make address-not-available errors less likely
2019-07-17 23:20:11 +02:00
Sami Kerola
0934883fe1
mtr-packet: make address-not-available errors less likely
Use MIN_PORT to MAX_PORT port range to avoid getting EADDRNOTAVAIL caused by
sockets in FIN-WAIT-1 state.  This issue is easy to reproduce with following
loop (as root).

    src="$(ip route | awk '/default/ {print $9}')"
    while true; do
      echo "6000 send-probe ip-4 1.1.1.1 local-ip-4 $src port 443 protocol tcp" |
      ./mtr-packet
    done | head -n 10
    6000 reply ip-4 1.1.1.1 round-trip-time 11306
    6000 address-not-available
    6000 address-not-available
    [...]

Reported-by: Scott Pearson <scott@cloudflare.com>
Reproeuced-by: Jarred Trainor <jarred@cloudflare.com>
Signed-off-by: Sami Kerola <kerolasa@iki.fi> && <kerolasa@cloudflare.com>
2019-07-17 20:17:56 +01:00
Roger Wolff
60e5c5c8c6
Merge pull request #292 from matt-kimball/cygwin-signals
Rework Cygwin mtr-packet to respond to signals (such as SIGTERM)
2019-03-03 17:12:50 +01:00
Matt Kimball
059e23c5a0 Rework Cygwin mtr-packet to respond to signals (such as SIGTERM)
The prior implementation of mtr-packet on Cygwin would
not respond to Unix-style signals sent from other processes.
It was unkillable from the Cygwin shell, even with SIGKILL,
and exiting mtr would sometimes stall for several seconds because
it would ignore the SIGTERM sent from the main mtr process.
It would then wait for all outstanding probes to timeout before
exiting.

Signals were ignored because they are implemented by the Cygwin
library at the user level, (i.e. not provided by the OS kernel),
and mtr-packet often bypassed Cygwin's I/O functions by calling
Win32 APIs directly.

With this rework, the Cygwin implementation uses an ICMP service
thread to call the Win32 ICMP functions, but the main thread
uses a POSIX-style select() loop, similar to the Unix version mtr.

I would have liked to avoid multithreading entirely, but here are
the constraints:

    a)  mtr was originally a Unix program which used "raw sockets"
    b)  In order to port mtr to Windows, Cygwin is used to get a
        Unix-like environment
    c)  You can't use a raw socket to receive an ICMP reply on Windows.
        However, Windows provides a separate API in the form of
        ICMP.DLL for sending and receiving ICMP messages.
    d)  The ICMP API works asynchronously, and requires completion
        through an asynchronous procedure call ("APC")
    e)  APCs are only delivered during blocking Win32 operations
        which are flagged as "alertable."  This prevents apps from
        having APCs execute unexpectedly during an I/O operation.
    f)  Cygwin's implementation of POSIX functions does all I/O
        through non-alertable I/O operations.  This is reasonable
        because APCs don't exist in the POSIX API.
    g)  Cygwin implements Unix-style signals at the application level,
        since the Windows kernel doesn't have them.  We want our
        program to respond to SIGTERM and SIGKILL, at least.
    h)  Cygwin's signal implementation will deliver signals during
        blocking I/O functions in the Cygwin library, but won't
        respond to signals if the signal is sent while the application
        is in a blocking Windows API call which Cygwin is not aware of.
    i)  Since we want to both send/receive ICMP probes and also respond
        to Unix-style signals, we require two threads:  one which
        uses Cygwin's POSIX style blocking I/O and can respond to
        signals, and one which uses alertable waits using Win32
        blocking APIs.

The solution is to have the main thread using select() as the
blocking operation in its loop, and also to have an ICMP service
thread using WaitForSingleObjectEx() as its blocking operation.
The main thread will respond to signals.  The ICMP service thread
will run the APCs completing ICMP.DLL requests.

This change doesn't affect non-Windows versions of mtr, other than
moving the code from command_unix.c back into command.c,
since it can now be shared between Unix-like systems and Windows.
2019-03-03 08:00:55 -08:00
Roger Wolff
30c60d1535
Merge pull request #291 from angt/add-help-line-curses
Add a help line for the t command in curses
2019-02-28 13:27:27 +01:00
Adrien Gallouët
0cd546fe8b Add a help line for the t command in curses
Signed-off-by: Adrien Gallouët <adrien@gallouet.fr>
2019-02-28 11:53:52 +00:00
Roger Wolff
351a803616
Merge pull request #290 from matt-kimball/mtrpacket-python-manpage
Mention Python mtrpacket package in mtr-packet man page
2019-02-14 12:21:38 +01:00
Rogier Wolff
0560918c58 Manpage fix for Darwin by Matt. Rewritten by REW 2019-02-14 12:18:41 +01:00
Roger Wolff
a33ab83d54
Merge pull request #288 from matt-kimball/macos-error-func
Link portability/error.c with mtr-packet when missing on MacOS
2019-02-14 11:55:24 +01:00
Matt Kimball
c1f44e13a1 Mention Python mtrpacket package in mtr-packet man page
There is now a package for Python which invokes mtr-packet and sends
network probes asynchronously:  https://pypi.org/project/mtrpacket/

This change adds mention of it to the mtr-packet man page, which
should help people interested in using mtr-packet in monitoring scripts
find it.
2019-02-13 10:30:01 -08:00
Matt Kimball
f54da716ac Link portability/error.c with mtr-packet when missing on MacOS
Change 817f171d broke the MacOS build.

Change 817f171d converted the error reporting in mtr-packet from
perror() to error().  That's fine, but error() is missing on MacOS.
We already had portability/error.c for this reason, but that was
previously only linked into the mtr binary, not mtr-packet.

This change also links portability/error.c with mtr-packet, when
error() is missing from the OS.
2019-02-13 09:33:29 -08:00
Rogier Wolff
3649b04337 Fixed issue #286 2019-01-01 13:27:57 +01:00
Roger Wolff
7e511aa4bc
Merge pull request #284 from Ablesius/ReadmeMarkdown
convert README to markdown
2018-12-19 12:43:35 +01:00
Alexander Blesius
a05f4b7f35 convert README to markdown 2018-12-18 15:53:21 +01:00
Roger Wolff
e41c2135ea
Merge pull request #276 from trittweiler/master
Print program name before error messages.
2018-11-15 16:39:46 +01:00