]> git.ipfire.org Git - thirdparty/mtr.git/commit
mtr-packet: drop capabilities + using BSD's linked lists for probes
authorMatt Kimball <matt.kimball@gmail.com>
Sun, 25 Dec 2016 17:26:34 +0000 (09:26 -0800)
committerMatt Kimball <matt.kimball@gmail.com>
Sun, 25 Dec 2016 17:26:34 +0000 (09:26 -0800)
commit2ff8de310222d26d10b13a104a1a82f2b86a84c6
treeedcc298c8c4c8b92460d34110b8cb837da9fbb45
parent5f76affc0e58a64a4238fafe6e61241769fc205d
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.
18 files changed:
BSDCOPYING [new file with mode: 0644]
Makefile.am
SECURITY
configure.ac
packet/command.c
packet/command_cygwin.c
packet/command_unix.c
packet/deconstruct_unix.c
packet/packet.c
packet/probe.c
packet/probe.h
packet/probe_cygwin.c
packet/probe_cygwin.h
packet/probe_unix.c
packet/probe_unix.h
packet/wait_cygwin.c
packet/wait_unix.c
portability/queue.h [new file with mode: 0644]