]> git.ipfire.org Git - thirdparty/mtr.git/log
thirdparty/mtr.git
7 years agoUpdate deconstruct_unix.c 241/head
SaintBol [Tue, 20 Mar 2018 23:58:33 +0000 (00:58 +0100)] 
Update deconstruct_unix.c

RFC 5462 - MPLS EXP Field renamed to TC Field (Traffic Class)

7 years agoMerge pull request #235 from kanet77/master
Roger Wolff [Sun, 26 Nov 2017 10:29:59 +0000 (11:29 +0100)] 
Merge pull request #235 from kanet77/master

Fix typo (resove -> resolve)

7 years agoFix typo (resove -> resolve) 235/head
tk [Sun, 26 Nov 2017 06:25:56 +0000 (00:25 -0600)] 
Fix typo (resove -> resolve)

7 years agobetter fix. to dave's problem.
R.E. Wolff [Tue, 21 Nov 2017 16:20:42 +0000 (17:20 +0100)] 
better fix. to dave's problem.

7 years agofixed split like for macos
R.E. Wolff [Tue, 21 Nov 2017 14:50:41 +0000 (15:50 +0100)] 
fixed split like for macos

7 years agoMerge branch 'master' of github.com:traviscross/mtr
R.E. Wolff [Tue, 7 Nov 2017 17:25:15 +0000 (18:25 +0100)] 
Merge branch 'master' of github.com:traviscross/mtr

7 years agoSami Kerola: prevent MTR reporting unknown revision
R.E. Wolff [Tue, 7 Nov 2017 16:24:14 +0000 (17:24 +0100)] 
Sami Kerola: prevent MTR reporting unknown revision

7 years agoMerge pull request #228 from Debian/samueloph-typo
Roger Wolff [Sun, 15 Oct 2017 17:06:57 +0000 (19:06 +0200)] 
Merge pull request #228 from Debian/samueloph-typo

[typo]mtr.8.in: s/allows to/allows one to/

7 years ago[typo]mtr.8.in: s/allows to/allows one to/ 228/head
Samuel Henrique [Sun, 15 Oct 2017 17:03:22 +0000 (15:03 -0200)] 
[typo]mtr.8.in: s/allows to/allows one to/

7 years agopossible fix for mac terminal 100% problem
R.E. Wolff [Mon, 2 Oct 2017 13:36:04 +0000 (15:36 +0200)] 
possible fix for mac terminal 100% problem

7 years agoMerge pull request #222 from linghutiantian/bug-fix
Roger Wolff [Fri, 8 Sep 2017 15:44:02 +0000 (17:44 +0200)] 
Merge pull request #222 from linghutiantian/bug-fix

mtr-packet: fix a bug causing IPv6 raw socket not working

7 years agomtr-packet: fix a bug causing IPv6 raw socket not working 222/head
Chonggang Li [Wed, 6 Sep 2017 21:23:01 +0000 (14:23 -0700)] 
mtr-packet: fix a bug causing IPv6 raw socket not working

This bug causes mtr not working on IPv6 only machines if invoked by root
user, and it is fixed in this commit.

Change-Id: Iaefa548728b668bb64fbb5330bd1365f1af7b9b1

7 years agoMerge pull request #215 from linghutiantian/dev/dgram_socket
Roger Wolff [Mon, 28 Aug 2017 08:32:57 +0000 (10:32 +0200)] 
Merge pull request #215 from linghutiantian/dev/dgram_socket

mtr-packet: use ICMP and UDP without privilege on linux

7 years agomtr-packet: fix compilation on OS X 215/head
Chonggang Li [Mon, 21 Aug 2017 20:34:45 +0000 (13:34 -0700)] 
mtr-packet: fix compilation on OS X

Error queue is not supported by OS X, use AC_CHECK_HEADERS to introduce
a compilation flag called HAVE_LINUX_ERRQUEUE_H to skip compiling errqueue
related code.

7 years agoMerge pull request #218 from robert-scheck/fsf-address
Roger Wolff [Sun, 27 Aug 2017 05:51:21 +0000 (07:51 +0200)] 
Merge pull request #218 from robert-scheck/fsf-address

Update incorrect FSF address

7 years agoUpdate incorrect FSF address 218/head
Robert Scheck [Sat, 26 Aug 2017 22:21:47 +0000 (00:21 +0200)] 
Update incorrect FSF address

7 years agomtr-packet: fix Windows compilation
Chonggang Li [Wed, 23 Aug 2017 07:56:36 +0000 (00:56 -0700)] 
mtr-packet: fix Windows compilation

7 years agofix stupid typo. Thanks adpoliak!
R.E. Wolff [Thu, 17 Aug 2017 14:10:46 +0000 (16:10 +0200)] 
fix stupid typo. Thanks adpoliak!

7 years agoAlternative 'skip uid 0 checks on cygwin' to adpoliak's implmentation
R.E. Wolff [Thu, 17 Aug 2017 07:53:25 +0000 (09:53 +0200)] 
Alternative 'skip uid 0 checks on cygwin' to adpoliak's implmentation

7 years agomtr-packet: use ICMP and UDP without privilege on linux
Chonggang Li [Thu, 13 Jul 2017 23:17:08 +0000 (16:17 -0700)] 
mtr-packet: use ICMP and UDP without privilege on linux

This commit enables non-privileged users to use mtr on linux without
setuid. Currently ICMP and UDP protocols are supported in this commit.
Previously, to use mtr on linux with protocol ICMP and UDP, RAW sockets
have to be opened to send out packets and receive ICMP errors, so users
must have RAW socket permission to use this program. The goal of this
commit is to make mtr usable for normal users without RAW socket
permission. The changes include:
(1) The origianl logic is not changed, but instead, when the program
fails to open RAW sockets, it will fallback to opening DGRAM scoekts.
(2) A new flag is created to indicate whether RAW socket is used for
IPv4 and IPv6 respectively.
(3) When using DGRAM sockets to send out packets, receive sockets are
not required. Instead, IP_RECVERR is enabled to receive ICMP errors.
(4) Packet receiving function is changed from recvfrom() to recvmsg() to
retrieve more information.
(5) When error is indicated, the program will check the error type and
read from the error queue of the socket. Original payload causing the
error will be read out from the error queue to match for probe, and
additional data (e.g. source ip of ICMP error packets) will be retrieved
from CMSG.
(6) Use a separate socket to probe byter order if raw socket creation
fails, to avoid double bind issue.
(7) Also a few tweaks are added to make non-RAW socket working.

Change-Id: Idb08ff0847adbabd23cdc031907de3bde08a6afc

8 years agoMerge pull request #211 from matt-kimball/ifname
Roger Wolff [Sun, 16 Jul 2017 19:49:44 +0000 (21:49 +0200)] 
Merge pull request #211 from matt-kimball/ifname

commandline: Added --interface for using a named network interface

8 years agocommandline: Added --interface for using a named network interface 211/head
Matt Kimball [Sun, 16 Jul 2017 17:19:32 +0000 (10:19 -0700)] 
commandline: Added --interface for using a named network interface

Using '--interface' on the commandline (or '-I') will specify
a network interface by name.  This is sometimes a more convenient
alternative to using '--address' for specifying a source address
from which to send probes.

This can be useful when you have both a wired ethernet connection
and WiFi connection, and wish to use a specific connection for the
purposes of tracing.

This feature was requested in issue #207.

This change also cleans up main() slightly by factoring out the
hostent structure generation.

8 years agoMerge pull request #209 from matt-kimball/netunreach
Roger Wolff [Fri, 14 Jul 2017 05:36:11 +0000 (07:36 +0200)] 
Merge pull request #209 from matt-kimball/netunreach

Report "no route to host" in curses UI when a probe response arrives with an ICMP destination unreachable code

8 years agoMerge pull request #210 from matt-kimball/badjson
Roger Wolff [Thu, 13 Jul 2017 05:53:29 +0000 (07:53 +0200)] 
Merge pull request #210 from matt-kimball/badjson

json: Fix malformed json when the "hubs" list is empty

8 years agojson: Fix malformed json when the "hubs" list is empty 210/head
Matt Kimball [Wed, 12 Jul 2017 19:48:46 +0000 (12:48 -0700)] 
json: Fix malformed json when the "hubs" list is empty

When generating JSON output, and when no hosts are found when
probing, the generated JSON was malformed.  (i.e. when the "hubs" list
in the generated JSON is empty, there was no closing bracket.)  This can
be reproduced by tracing to an unused host address on the local subnet.

This fixues issue #190.

8 years agoui: display "no route to host" error as host entry rather than abort 209/head
Matt Kimball [Tue, 11 Jul 2017 21:55:40 +0000 (14:55 -0700)] 
ui: display "no route to host" error as host entry rather than abort

When a host is reported as unreachable in response to a particular
network probe, the Windows version of the mtr UI had the unfortuante
behavior of exiting and and printing a terse message.  This is
surprising to a user, who would expect mtr probes and reporting to
continue.

With this change, probing continues and a status reading
"no route to host" is displayed in the probe report.

This change will also improve the reporting of the Unix version of
mtr, now specifying "no route to host" instead of misleadingly
indicating that no reply has been received.

This fixes issue #179.

8 years agomtr-packet: report ICMP destination unreachable probes as "no route to host"
Matt Kimball [Tue, 11 Jul 2017 01:01:25 +0000 (18:01 -0700)] 
mtr-packet: report ICMP destination unreachable probes as "no route to host"

When an ICMP reply of type destination unreachable is received, report
the probe status as "no-route".

The exception is the port unreacable subtype of destination unreachable,
which may occur normally when using a non-ICMP probe type.

8 years agofix #204 : added exec of mtr-packet in the place where mtr was started from. Quick...
R.E. Wolff [Sun, 18 Jun 2017 10:45:16 +0000 (12:45 +0200)] 
fix #204 : added exec of mtr-packet in the place where mtr was started from. Quick and dirty, There is probably a better place to declare variables.

8 years agominor changes top help Windows compilation on 32 bit machines
R.E. Wolff [Sat, 3 Jun 2017 17:01:04 +0000 (19:01 +0200)] 
minor changes top help Windows compilation on 32 bit machines

8 years agofixed some outdated text in README.
R.E. Wolff [Fri, 2 Jun 2017 12:54:40 +0000 (14:54 +0200)] 
fixed some outdated text in README.

8 years agoThe release script bumped the version number v0.92
R.E. Wolff [Fri, 2 Jun 2017 08:54:58 +0000 (10:54 +0200)] 
The release script bumped the version number

8 years agoadded a few arguments to calls added by fmazu. Allows it to compile.
R.E. Wolff [Fri, 2 Jun 2017 08:52:58 +0000 (10:52 +0200)] 
added a few arguments to calls added by fmazu. Allows it to compile.

8 years agoThe release script bumped the version number v0.91
R.E. Wolff [Fri, 2 Jun 2017 08:20:18 +0000 (10:20 +0200)] 
The release script bumped the version number

8 years agoThe release script bumped the version number
R.E. Wolff [Fri, 2 Jun 2017 08:18:28 +0000 (10:18 +0200)] 
The release script bumped the version number

8 years agoThe release script bumped the version number v0.90
R.E. Wolff [Fri, 2 Jun 2017 08:16:48 +0000 (10:16 +0200)] 
The release script bumped the version number

8 years agoMerge branch 'master' of github.com:traviscross/mtr
R.E. Wolff [Fri, 2 Jun 2017 08:14:51 +0000 (10:14 +0200)] 
Merge branch 'master' of github.com:traviscross/mtr

8 years agoThe release script bumped the version number v0.89
R.E. Wolff [Fri, 2 Jun 2017 08:14:09 +0000 (10:14 +0200)] 
The release script bumped the version number

8 years agoMerge pull request #197 from fmazu/json_asn
Roger Wolff [Fri, 2 Jun 2017 07:09:03 +0000 (09:09 +0200)] 
Merge pull request #197 from fmazu/json_asn

Add AS number to json output

8 years agoAdd AS number to json output 197/head
fmazullo [Fri, 2 Jun 2017 06:30:58 +0000 (15:30 +0900)] 
Add AS number to json output

8 years agoThe release script bumped the version number
R.E. Wolff [Fri, 2 Jun 2017 05:39:46 +0000 (07:39 +0200)] 
The release script bumped the version number

8 years agoMerge pull request #195 from dajohi/select
Roger Wolff [Mon, 17 Apr 2017 11:35:14 +0000 (13:35 +0200)] 
Merge pull request #195 from dajohi/select

include <sys/select.h> for fd_set

8 years agoinclude <sys/select.h> for fd_set 195/head
David Hill [Fri, 14 Apr 2017 22:08:56 +0000 (18:08 -0400)] 
include <sys/select.h> for fd_set

8 years agoMerge pull request #192 from jwilk/spelling
Roger Wolff [Tue, 28 Feb 2017 08:11:12 +0000 (09:11 +0100)] 
Merge pull request #192 from jwilk/spelling

Fix typos

8 years agoFix typos 192/head
Jakub Wilk [Mon, 27 Feb 2017 22:52:08 +0000 (23:52 +0100)] 
Fix typos

8 years agoMerge pull request #189 from matt-kimball/reindent
Roger Wolff [Sun, 5 Feb 2017 07:11:21 +0000 (08:11 +0100)] 
Merge pull request #189 from matt-kimball/reindent

Reindent source using GNU indent

8 years agocleanup: reindented C source with GNU indent 189/head
Matt Kimball [Sat, 4 Feb 2017 21:25:23 +0000 (13:25 -0800)] 
cleanup: reindented C source with GNU indent

Ran the C source through:

    indent --k-and-r-style --no-tabs --break-function-decl-args

8 years agocleanup: Fix #ifdef structure which confuses 'ident'
Matt Kimball [Sat, 4 Feb 2017 21:18:13 +0000 (13:18 -0800)] 
cleanup: Fix #ifdef structure which confuses 'ident'

The 'indent' tool is confused by some strange #ifdef structure
around HAVE_IPINFO in report.c.  Cleaned up that structure
so 'indent' can be used successfully.

8 years agoMore whitespace mangling for consistency in net.c
R.E. Wolff [Fri, 27 Jan 2017 08:40:49 +0000 (09:40 +0100)] 
More whitespace mangling for consistency in net.c

8 years agoMerge pull request #188 from jbruggeman/master
Roger Wolff [Fri, 27 Jan 2017 08:36:34 +0000 (09:36 +0100)] 
Merge pull request #188 from jbruggeman/master

Improve readability of net.c

8 years agocleanup the if blocks in net.c to improve readability 188/head
Joe Bruggeman [Thu, 26 Jan 2017 21:40:53 +0000 (16:40 -0500)] 
cleanup the if blocks in net.c to improve readability

8 years agoReplace all tabs tabs in net.c with spaces
Joe Bruggeman [Thu, 26 Jan 2017 21:31:32 +0000 (16:31 -0500)] 
Replace all tabs tabs in net.c with spaces

Partial fix for #187

8 years agoput ifdefs around IPV6 only part. Fixes #184
R.E. Wolff [Tue, 17 Jan 2017 23:04:26 +0000 (00:04 +0100)] 
put ifdefs around IPV6 only part. Fixes #184

8 years agoasn fix from meingtsla, fixes #163. Pong!
R.E. Wolff [Sat, 14 Jan 2017 23:51:47 +0000 (00:51 +0100)] 
asn fix from meingtsla, fixes #163. Pong!

8 years agoMerge pull request #181 from matt-kimball/cygwin-host-unreach
Roger Wolff [Sun, 8 Jan 2017 16:17:30 +0000 (17:17 +0100)] 
Merge pull request #181 from matt-kimball/cygwin-host-unreach

mtr-packet: Report probe status on host unreachable (Cygwin)

8 years agomtr-packet: Report probe status on host unreachable (Cygwin) 181/head
Matt Kimball [Sat, 7 Jan 2017 17:01:30 +0000 (09:01 -0800)] 
mtr-packet: Report probe status on host unreachable (Cygwin)

When IcmpParseReplies returned with a probe completion, but the
probe's status was IP_DEST_HOST_UNREACHABLE, mtr-packet was failing
to report the probe result, and was instead printing an unhelpful
error message without any reference to a particular probe.  Now
it will report a "no-route" result with the token associated with
the probe.

This fixes issue #179.

8 years agoMerge pull request #180 from kerolasa/pedantry
Roger Wolff [Sat, 7 Jan 2017 12:01:13 +0000 (13:01 +0100)] 
Merge pull request #180 from kerolasa/pedantry

couple maintenance changes

8 years agodocs: FSF moved back in 2005 180/head
Sami Kerola [Fri, 6 Jan 2017 22:04:18 +0000 (22:04 +0000)] 
docs: FSF moved back in 2005

Update license file from the source.

Reference: https://www.fsf.org/news/fsf-moving.html
Source: https://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
8 years agobuild-sys: update .gitignore file
Sami Kerola [Sun, 1 Jan 2017 19:29:59 +0000 (19:29 +0000)] 
build-sys: update .gitignore file

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
8 years agosmatch: fix couple warnings
Sami Kerola [Sun, 1 Jan 2017 19:25:24 +0000 (19:25 +0000)] 
smatch: fix couple warnings

ui/mtr.c:616:21: warning: Using plain integer as NULL pointer
packet/cmdparse.c:80:18: warning: Variable length array is used.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
8 years agosmatch: extern keyword is needed only in header
Sami Kerola [Sun, 1 Jan 2017 19:19:22 +0000 (19:19 +0000)] 
smatch: extern keyword is needed only in header

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
8 years agoMerge pull request #178 from kasper93/errno
Roger Wolff [Thu, 5 Jan 2017 15:09:01 +0000 (16:09 +0100)] 
Merge pull request #178 from kasper93/errno

Add missing errno.h include.

8 years agoMerge pull request #177 from kasper93/master
Roger Wolff [Thu, 5 Jan 2017 15:07:57 +0000 (16:07 +0100)] 
Merge pull request #177 from kasper93/master

Change finding of mtr-packet a bit to make things more convenient for developers/hackers.

8 years agoAdd missing errno.h include. 178/head
Kacper MichajÅ‚ow [Wed, 4 Jan 2017 16:53:18 +0000 (17:53 +0100)] 
Add missing errno.h include.

This fixes compilation with Clang on Cygwin.

8 years agoRelax mtr-packet search rules. 177/head
Kacper MichajÅ‚ow [Tue, 3 Jan 2017 22:28:45 +0000 (23:28 +0100)] 
Relax mtr-packet search rules.

First, mtr-packet or override path taken from MTR_PACKET env variable will be search in PATH if not found we falllback to current directory search. This way we can use mtr without installing or setting any additional env variables.

Also fix batch file to support paths with spaces on Windows.

8 years agoMerge pull request #175 from matt-kimball/portability-fixes
Roger Wolff [Sat, 31 Dec 2016 18:04:59 +0000 (19:04 +0100)] 
Merge pull request #175 from matt-kimball/portability-fixes

Portability fixes - Solaris, NetBSD and OpenBSD

8 years agobuild: fix compiler warnings when for OpenBSD, NetBSD and Solaris 175/head
Matt Kimball [Fri, 30 Dec 2016 16:32:45 +0000 (16:32 +0000)] 
build: fix compiler warnings when for OpenBSD, NetBSD and Solaris

When building for NetBSD, the compiler was warning about
index into an array with a character when using isspace() and
similar macros.

IPPROTO_SCTP is also not defined by NetBSD, so there were
warnings about unused SCTP related variables.

OpenBSD complains about using sprintf rather than snprintf.
It's a good idea to use snprintf, anyway, to avoid buffer overruns,
though I believe in these particular cases sprintf was safe.
Nevertheless, snprintf is now used instead.

Solaris requires strings.h to find index().

Solaris complaints about a missing sentinel pointer unless
the terminating NULL in execl is cast to a "char *".

8 years agobuild: Fix Solaris build issues
Matt Kimball [Fri, 30 Dec 2016 19:44:32 +0000 (11:44 -0800)] 
build: Fix Solaris build issues

Prefer ncurses over curses, since curses on Solaris is lacking
wattr_on and wattr_off, but ncurses has them.

Check if sys/ctypes.h exists, since Solaris lacks it.

When sending an IPv6 probe, check if the send socket is already
bound to the intended source address, and if so, avoid rebinding.
Rebinding return an error on Solaris.

8 years agobuild: if linking with ncurses fails, try curses (for NetBSD)
Matt Kimball [Fri, 30 Dec 2016 16:22:32 +0000 (16:22 +0000)] 
build: if linking with ncurses fails, try curses  (for NetBSD)

NetBSD doesn't use ncurses, but instead has its own version of curses.
So, if we don't find ncurses during configure, try linking against
curses.

On NetBSD, we must include limits.h to find CHAR_MAX.

On OpenBSD, we must include sys/socket.h to get sockaddr_storage.

8 years agoMerge pull request #174 from matt-kimball/ipv6-disabled-fallback
Roger Wolff [Thu, 29 Dec 2016 07:05:13 +0000 (08:05 +0100)] 
Merge pull request #174 from matt-kimball/ipv6-disabled-fallback

mtr-packet: Fall back to IPv4 only support if IPv6 sockets fail to open

8 years agomtr-packet: Fall back to IPv4 only support if IPv6 sockets fail to open 174/head
Matt Kimball [Wed, 28 Dec 2016 01:09:49 +0000 (17:09 -0800)] 
mtr-packet: Fall back to IPv4 only support if IPv6 sockets fail to open

If we fail to open any IPv6 sockets, rather than aborting with an
unrecoverable error, fall back to IPv4 only support.  Socket
creation might fail, for example, when Linux is booted with
the kernel command-line "ipv6.disable=1".

In the case where opening IPv6 sockets fail,
'check-support feature ip-6' will indicate there is no support
for sending IPv6 probes.

Stricter error reporting revealed that test for protocols other
than ICMP were running on Cygwin.  Modified the tests such that
they won't run if the protocol isn't supported.

8 years agoMerge pull request #172 from matt-kimball/ncurses-check
Roger Wolff [Mon, 26 Dec 2016 21:34:46 +0000 (22:34 +0100)] 
Merge pull request #172 from matt-kimball/ncurses-check

build: use AC_CHECK_LIB for ncurses, rather than pkg-tool

8 years agobuild: use AC_CHECK_LIB for ncurses, rather than pkg-tool 172/head
Matt Kimball [Mon, 26 Dec 2016 09:26:01 +0000 (01:26 -0800)] 
build: use AC_CHECK_LIB for ncurses, rather than pkg-tool

pkg-tool is indeed an elegant way to check for the presence
of libraries.  When using pkg-config to check for ncurses, this
works great... for Linux.  Unfortunately, on FreeBSD and MacOS,
ncurses is installed by default, but pkg-config is not.  When
pkg-config is installed on these systems, it doesn't know about
the system installed ncurses.

Therefore, somewhat counterintuitively, it is better for portability
to just us AC_CHECK_LIB instead of PKG_CHECK_MODULES to find
ncurses.

8 years agoMerge pull request #171 from matt-kimball/master
Roger Wolff [Sun, 25 Dec 2016 22:14:11 +0000 (23:14 +0100)] 
Merge pull request #171 from matt-kimball/master

split raw socket access into mtr-packet subprocess

8 years agobuild: moved front-end source into ui subdir 171/head
Matt Kimball [Sun, 25 Dec 2016 17:45:52 +0000 (09:45 -0800)] 
build: moved front-end source into ui subdir

Cleaned up the directory structure.

Moved the source to the main mtr executable into the ui/ subdirectory.

Moved mtr.bat and mangen.sh into build-aux/

Moved the man pages into man/

Fixed a few omissions in Makefile.am for 'make dist'

8 years agomtr-packet: drop capabilities + using BSD's linked lists for probes
Matt Kimball [Sun, 25 Dec 2016 17:26:34 +0000 (09:26 -0800)] 
mtr-packet: drop capabilities + using BSD's linked lists for probes

At startup, we now use cap_set_proc to drop all privileged
capabilities for the mtr-packet process.  This means that
capabilities granted through the commandline setcap to the
mtr-packet executable will only be in effect while the necessary
raw sockets are opened, and will be dropped before any command
requests are read.

Now we use BSD's queue.h linked list support for storing outstanding
probes.  This makes iterating through in-flight probes more efficient,
as we don't need to loop through many unused probe entires when only
a few probes are outstanding.

Changed mtr-packet's default probe size to 64 bytes, to match
mainline mtr's default.

The code consistently uses 'exit(EXIT_FAILURE)' instead of 'exit(1)'.
The effect is the same, but the intent is clearer.

8 years agoMerge branch mtr-packet into 'master'
Matt Kimball [Fri, 23 Dec 2016 17:56:58 +0000 (09:56 -0800)] 
Merge branch mtr-packet into 'master'

8 years agomtr-packet: allow local address binding
Matt Kimball [Fri, 23 Dec 2016 17:37:47 +0000 (09:37 -0800)] 
mtr-packet: allow local address binding

A probe can be bound to a local address with the 'local-ip-4' or
'local-ip-6' arguments to 'send-probe'.  The '-a' commandline
argument to mtr will cause sent probes to be bound to the specified
address.

Changed argument names for consistency:

    'localport' is now 'local-port'
    'bitpattern' is now 'bit-pattern'

mtr now opens and connects a UDP socket at startup to determine the
local address for display in the UI.

Windows error codes resulting from send-probe are now using the
same error strings which are used to report errors in the
Unix implementation.

We now use the mtr commandline timeout value for sent probes.
Edited the help and man page to reflect that the timeout value
no longer applies to only TCP probes, but now all probes.

With this change, I believe the mtr-packet implementation is at
feature parity with mainline mtr.

8 years agomtr-packet: MPLS decoding and local UDP port usage
Matt Kimball [Thu, 22 Dec 2016 15:28:29 +0000 (07:28 -0800)] 
mtr-packet: MPLS decoding and local UDP port usage

mtr-packet will decode any MPLS labels embedded in an
ICMP reply which results from a probe, and report those
labels with the probe reply.

When sending a UDP probe, a local port can be specified
for probe origination.  In the same way that the legacy mtr
code found a location to store a unique identifier for the probe,
we'll use the destination port, the local port or the checksum
field, depending on what probe arguments have been specified.

Both MPLS and local UDP port options have been documented in the
mtr-packet man page.

Update the SECURITY documentation to reflect mtr-packet, and did
minor copyediting in the README.  Also, update my email address
in AUTHORS.

8 years agomtr-packet: TCP and SCTP probes
Matt Kimball [Tue, 20 Dec 2016 18:09:29 +0000 (10:09 -0800)] 
mtr-packet: TCP and SCTP probes

Added support for generating probes using TCP or SCTP, for both
IPv4 and IPv6.  These protocols require that we create a unique
socket for each probe and watch for either a TTL expiration of
the initial packet sent during a connection attempt from that
socket or for socket connection success.

We now allocate a unique port number or ICMP sequence ID when
a probe is created, rather than using the command token for this
purpose.  This relieves the calling application of the burden
of picking sensible command token values, and allows command
tokens values greater than 16 bits.  However, the existing mtr
code continues to use the same command tokens values it has
previously used as port numbers, so there is no difference when
the calling program is mtr.

Split mtr's command pipe handling out from net.c and into cmdpipe.c
in the interest of future maintainability.

Split probe.py's simple probes out from the individual protocol
test cases and into common code which can be used by many
protocol tests.

8 years agoMerge pull request #165 from kerolasa/2016-10-29
Roger Wolff [Mon, 19 Dec 2016 09:15:12 +0000 (10:15 +0100)] 
Merge pull request #165 from kerolasa/2016-10-29

2016-10-29 usage improvements

8 years agomtr-packet: packet customization options (size, fill, mark, tos)
Matt Kimball [Sat, 17 Dec 2016 15:24:07 +0000 (07:24 -0800)] 
mtr-packet: packet customization options (size, fill, mark, tos)

Added send-probe arguments to customize the packet size,
the bitpattern which fills the packet, the IP "type of service"
and the Linux routing mark.  These arguments are documented
in the mtr-packet man page, and have been hooked up to mtr's
commandline parameters.

Internally to mtr-packet, the code is now more consistent about
using errno to return error codes.

Added instrutions for building on Windows to the README.

Fixed the Makefile to build the man pages with BSD make, for FreeBSD.
BSD make lacks the GNU make extension for '%' wildcard matching.

Added a helper program for testing which listens for an ICMP
packet with a particular sequence and prints information about
that packet.

8 years agomtr-packet: UDP probe support
Matt Kimball [Wed, 14 Dec 2016 17:18:42 +0000 (09:18 -0800)] 
mtr-packet: UDP probe support

Added support send using UDP as the protocol for sending probes,
rather than ICMP.  Both IPv4 and IPv6 UDP probes are supported.
We are using the source port in the UDP packet for identifying
the particular probe transmitted.  This is a bit less reliable
than ICMP, where we are also able to store our PID for verifying
the probe has been transmitted by this instance of mtr-packet,
but space is limited, and it is what the pre-existing mtr
implementation does.

We report no-route and network-down errors in response to errors
from sendto(), in addition to reporting them from errors in
the connect() used to determine the source address of an outgoing
probe.

The mtr-packet tests now properly parse the replies from
mtr-packet, as opposed to simply matching regular expressions
against the output.  This is better because it give us future
compatibility with additional reply arguments from mtr-packet.

A better introduction to mtr-packet is now included in the
mtr-packet man page.

The dual code paths for sending IPv6 probes between Linux
and non-Linux Unix-likes has been eliminated.  The Linux path
gave us direct control over the IP header, but wasn't necessary
and would make maintainence more difficult, so now Linux uses
the more indirect setsockopt() method of setting IPv6 header
fields.

8 years agomtr-packet: IPv6 support
Matt Kimball [Fri, 9 Dec 2016 19:14:06 +0000 (11:14 -0800)] 
mtr-packet: IPv6 support

mtr-packet can now send and receive ICMPv6 probes.

We now determine the source address for an outgoing probe by
opening a UDP socket to the destination, though no outgoing packets
are sent through this UDP socket.  IPv6 made this necessary, but
it now occurs for IPv4, too.

mtr-packet now uses sockaddr_storage for passing around addresses,
rather than sockaddr_in, as it can work for either IPv4 or IPv6.

To improve the maintainability of the code, the packet construction
and interpetation has been moved from probe_unix.c to construct_unix.c
and deconstruct_unix.c.

The way that Windows reads from the command stream has been changed to
avoid the possibility of hanging in a Sleep without an active read
of the command stream.

"send-probe" will now respond with "no-route" or "network-down"
when those conditions apply.

The test code has been moved to a test directory and split into
the following modules:

probe.py - tests for sending probes
cmdparse.py - tests for command parsing
mtrpacket.py - infrastructure for testing mtr-packet

The mtr-packet man page has been updated to describe ip-6 options
and now has an example of tracing a route to a remote host.

The mtr-packet network initialization has been split into two halves
to minimize the operations which occur with elevated privileges.

8 years agoMerge pull request #169 from matt-kimball/issue168-multihost
Roger Wolff [Wed, 7 Dec 2016 17:05:10 +0000 (18:05 +0100)] 
Merge pull request #169 from matt-kimball/issue168-multihost

cmdline: multiple host names dropped all but one host  (issue #168)

8 years agocmdline: multiple host names dropped all but one host (issue #168) 169/head
Matt Kimball [Wed, 7 Dec 2016 15:43:08 +0000 (07:43 -0800)] 
cmdline: multiple host names dropped all but one host  (issue #168)

Change 1ed2bab broke multiple host names, either specified through
the --filename option, or listed on the commandline.  This was
due to well-intentioned refactoring of the hostname linked list
management which happened to lose all host names other than the
last name in the list.

I've fixed the append_to_names to walk the list of host names before
appending a new host name.  This does make the building of host names
O(n^2) rather than O(n), but I'm skeptical that will impact anyone's
life in a negative way, because it only happens at startup, and
it does simplify the code.

Also, multiple host names will now work in all non-interactive modes
(i.e. report, txt, json, xml, raw, csv) instead of just CSV mode.

8 years agotest: Fix mtr-packet tests for Python 3
Matt Kimball [Sun, 4 Dec 2016 18:03:44 +0000 (10:03 -0800)] 
test: Fix mtr-packet tests for Python 3

The mtr-packet test suite was written to run with Python 2, and lacked
the Unicode to bytes and bytes to Unicode conversions required to
run with Python 3.  This change adds those conversions, and the result
works with either Python 2 or Python 3.

Also, close the subprocess's stdin and stdout explicitly.  Python 3's
unittest complains about unclosed file descriptors otherwise.

8 years agobuild-sys: update .gitignore file
Sami Kerola [Sun, 4 Dec 2016 10:48:16 +0000 (10:48 +0000)] 
build-sys: update .gitignore file

8 years agodocs: improve mtr-packet(8) manual page
Sami Kerola [Sun, 4 Dec 2016 10:43:45 +0000 (10:43 +0000)] 
docs: improve mtr-packet(8) manual page

Indent argument descriptions, and groff_man(7) style.

8 years agoAdded mtr-packet subprocess
Matt Kimball [Thu, 1 Dec 2016 01:14:43 +0000 (17:14 -0800)] 
Added mtr-packet subprocess

The mtr-packet tool isolates the raw socket sending/receiving of
packets from the mtr user interface.  By isolating the socket
interactions to a separate process, we can be sure that any security
flaws in the user-interface code doesn't expose a raw socket
interface to an attacker attempting to escalate privileges.

This is a bare-bones implementation, only support ICMP,
only support IP version 4, and missing many of the probe customization
features available in mtr.  It will require some more work to reach
feature parity with the current mtr implementation.  But it's a start.

The include mtr-packet man page explains the protocol format
used to communicate with this new process.

Included is an automated test for mtr-packet, implemented using
Python's unittest module.  Though the code actually being tested
is implemented in C, Python make it easy to write test cases.
'make check' will test the current build.

An alternate code-path for Windows is included in the mtr-packet
tool.  The mechanism for sending and receiving network probes
is significantly different for Windows, as compared to Unix-like
operating systems, but the interface provided by mtr-packet is
the same.  'make dist-windows-bin' will make a Windows binary
distribution.  A Cygwin build environment is required, but the
resulting binary distribution doesn't require that Cygwin be
already installed.

Tested on:

Ubuntu 16.10, FreeBSD 11.0, MacOS 10.12.1 (Sierra), Windows 7

Since the code changes are significant, more esoteric operating
systems may require changes.

8 years agodocs: add very basic --sctp documentation to manual page 165/head
Sami Kerola [Sat, 29 Oct 2016 13:43:43 +0000 (14:43 +0100)] 
docs: add very basic --sctp documentation to manual page

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
8 years agocleanup: use single logic to handle conditional options
Sami Kerola [Sat, 29 Oct 2016 13:19:16 +0000 (14:19 +0100)] 
cleanup: use single logic to handle conditional options

Options that exist depending on compile time configuration are made
conditional in usage() and getopt_long().  Removing not-supported options
from manual per compile time configuration would be nice, but making that to
work is a bit tricky.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
8 years agoMerge branch 'master' of github.com:traviscross/mtr
R.E. Wolff [Sat, 29 Oct 2016 09:50:34 +0000 (11:50 +0200)] 
Merge branch 'master' of github.com:traviscross/mtr

8 years agoheader alignment issue found&fixed by meingtsla. Fixes #164
R.E. Wolff [Sat, 29 Oct 2016 09:50:13 +0000 (11:50 +0200)] 
header alignment issue found&fixed by meingtsla. Fixes #164

8 years agoMerge pull request #162 from vaygr/row-color-fix
rewolff [Thu, 27 Oct 2016 22:05:41 +0000 (00:05 +0200)] 
Merge pull request #162 from vaygr/row-color-fix

Respect theme foreground color

8 years agorespect theme foreground color 162/head
Vlad Glagolev [Thu, 27 Oct 2016 15:45:30 +0000 (11:45 -0400)] 
respect theme foreground color

8 years agofixed dynamic DNS on/off switch. Fixed #160
R.E. Wolff [Wed, 26 Oct 2016 06:52:49 +0000 (08:52 +0200)] 
fixed dynamic DNS on/off switch. Fixed #160

8 years agoMerge branch 'master' of github.com:traviscross/mtr
R.E. Wolff [Wed, 26 Oct 2016 06:44:44 +0000 (08:44 +0200)] 
Merge branch 'master' of github.com:traviscross/mtr

8 years agore-initialize ipinfo_no and -max. Fixes #161.
R.E. Wolff [Wed, 26 Oct 2016 06:44:35 +0000 (08:44 +0200)] 
re-initialize ipinfo_no and -max. Fixes #161.

8 years agoMerge pull request #159 from kerolasa/2016-10-11
rewolff [Tue, 11 Oct 2016 21:12:51 +0000 (23:12 +0200)] 
Merge pull request #159 from kerolasa/2016-10-11

2016-10-11 let the dust settle

8 years agouser interface: do not allow out of range --ipinfo arguments 159/head
Sami Kerola [Tue, 11 Oct 2016 20:20:50 +0000 (21:20 +0100)] 
user interface: do not allow out of range --ipinfo arguments

Likewise --displaymode and --port.