trafgen: Don't modify optarg/argv

Follow commit bed9b6bb ("netsniff-ng: Don't modify optarg/argv").

We shouldn't modify optarg (and thus argv) since it's e.g. used to
display the commandline string in `ps'. Since strtoul() reads until it
encounters the first non-numeric character and ignores the rest, we can
just revert from setting a NULL byte after the numeric part of the
string.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
docs: update credits for former maintainership

Emma was former also one of the maintainer in the old days.

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
build: Use new git repo URL in release announcement message template

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
netsniff-ng: Exit gracefully for all possible termination signals

Handle all termination signals that we're allowed to handle (SIGKILL
can't be handled) in order to exit gracefully in any regular termination
case. Without this fix, pcap files written by netsniff-ng might be
corrupted.

Reported-by: Mike Westmacott <mikewestmacott@googlemail.com>
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
trafgen: Exit gracefully for all possible termination signals

Handle all termination signals that we're allowed to handle (SIGKILL
can't be handled) in order to exit gracefully in any regular termination
case.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
astraceroute: Exit gracefully for all possible termination signals

Handle all termination signals that we're allowed to handle (SIGKILL
can't be handled) in order to exit gracefully in any regular termination
case.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
flowtop: Exit gracefully for all possible termination signals

Handle all termination signals that we're allowed to handle (SIGKILL
can't be handled) in order to exit gracefully in any regular termination
case.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
ifpps: Exit gracefully for all possible termination signals

Handle all termination signals that we're allowed to handle (SIGKILL
can't be handled) in order to exit gracefully in any regular termination
case.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
build: Set SHELL make variable to bash if possible

On Debian/Ubuntu systems, /bin/sh is /bin/dash which doesn't understand
the -e option to the `echo' builtin. Thus the build output looks
something like the following:

Building netsniff-ng toolkit (0.5.8-rc5+) for x86_64-linux-gnu:
Building netsniff-ng:
-e   CC	dissector.c
-e   CC	dissector_eth.c
-e   CC	dissector_80211.c
...

Prevent this by setting SHELL to /bin/bash if it exists on the system,
otherwise stick to /bin/sh.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
ring: Get rid of unnecessary wrapper for get_sockopt_tpacket

get_sockopt_tpacket is never used in the "raw" version and the wrapper
does no additional checking anyway, so get rid of it.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
dissectors: Get rid of unecessary includes of protos.h

This header is actually only needed in dissector_eth and
dissector_80211, so remove the other users accordingly.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
conf: oui: update oui.conf

Update OUI entries using oui-update.py

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
ifpps: Reorder buffer allocation and file opening in stats_proc_interrupts

We don't need the file open to allocate the buffer so open it just
before it's used for the first time.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
dissectors: ethernet: Handle multicast/broadcast addresses properly

Until now, we just looked up the vendor string based on the OUI for each
MAC address. Thus, multicast and broadcast addresses were just printed
as "Unknown" which is a bit misleading.

Improve this situation by checking bit 0 of the 1st octet of the address
and by checking for the broadcast address if it is set. If a
multicast/broadcast address is found, the respective string is returned.
In all other cases, the existing OUI lookup is done.

In the future we might extend this mechanism to look up well-known
multicast addresses.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
build: fix syntax error when detecting SHELL make variable

Fix the shell syntax error, introduced in:
 commit 11c34c86ca4 (build: Set SHELL make variable to bash if possible)

Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
docs: install: Fix a minor typo

s/faily/fairly/

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
pcap_io: Only check byteswapped linktype if pcap magic is swapped

In pcap_validate_header() the linktype and the byte-swapped linktype are
currently checked against the supported linktypes. Since the swapped
linktype is always larger than LINKTYPE_MAX, only one of the two tests
was actually done. Make this intention a bit more clear by explicitly
checking only for either the swapped or non-swapped linktype, depending
on whether the pcap magic is swapped.

Also make the error messages a bit more verbose regarding the
major/minor version.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
man: manpage warning fixes

Usage: man --warnings -E UTF-8 -l -Tutf8 -Z foo.8 > /dev/null

Signed-off-by: Kartik Mistry <kartik.mistry@gmail.com>
Typo: longitude

Fixed typo in astraceroute.* files.

Signed-off-by: Kartik Mistry <kartik.mistry@gmail.com>
astraceroute.zsh: Remove duplicate entry

The entry for -q/--num-probes is duplicated in the zsh completion file
and the description of the first entry doesn't match the option's real
purpose, thus remove it.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>