build: add make release target

It is useful to have as much as possible scripted, to be less error-prone
and to have a uniform and simple workflow. Therefore, make the tagging,
tarball and mail message in a uniform way.

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
docs: add initial workflow document

Trying to document the workflow that comes along with using this Git
repository. Further ideas, additions to this document are welcome to
create a unified frame for all maintainers, developers and (advanced)
users.

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
build: get latest release tag via git-describe

To automatically create the shortlog for the .MAIL_MSG, we use
git shortlog. However, we do not want to include old stuff, so
let only commits pass that were between the previous release and
now. (Untested for now, since there is no futher tag.)

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
build: minor: do announcement before tagging

Do the announcement before the tagging is done, since we read out
the last tag in creating the shortlog.

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
docs: update git mirror urls

Some of the official Git mirror URLs were deprecated, so update them.

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
geoip: make sure we null-terminate after read

Make sure raw is null-terminated after we read the buffer that we
receive from the remote end. Detected by coverty scan.

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
netsniff-ng: do not leak file descriptors on exit

Covertiy detected that when we redirect sdtin/stdout either via
``-i -'' or ``-o -'', we also need to properly close it when it
goes out of scope.

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
geoip: reorder statements, so that file handles are closed first

Coverty detected, when we are in an error condition, we do not close
file handles, but just return instead. Thus, reorder statements, so
that file handles are closed for sure.

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
flowtop: close dir handle first before returning back

Coverty detected that the variable "dir" going out of scope leaks the
storage it points to. Thus close the handle first!

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
astraceroute: fix getnameinfo arguments

Coverty detected a misuse of the getnameinfo API, thus, we
need to fix the length parameter.

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
netsniff-ng trafgen: check return value of pull_and_flush_ring

Let us check the return value when the timer triggers a TX flush
request to the kernel. However, ignore the case of BADFS and NOBUFS.
The socket could already have been closed before the timer triggers
in the first case, and in the second, we just let the next timer
continue processing if currently the buffer space is exhausted.

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
netsniff-ng: if we cannot get intermediate pcap statistics, panic

Before we do calculations on statistics, check if we really got them.

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
ring: check return value of setsockopt

If something screws up, which is rather unlikely, but if it happens,
let the user know.

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
xutils: check various return values

Check various setsockopt return values and exit accordingly if some
of them just fuck up.

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
flowtop: rcu: omit rcu_assign_pointer

If the new pointer is NULL anyway, this results in a constant expression
during compile time (NULL != NULL) where a barrier is left out. Thus, it
will have no different effect using rcu_assign_pointer() than assigning
it directly.

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
misc: remove dead/unreachable code from switch statements

Remove various unreachable sections from the switch statements. This
was detected by the coverty scanner.

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
hash: simplify code and fix whitespacing

Make whitespacing more uniform to coding conventions and also simplify
some fubar if + xfree combinations by using free only.

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
ifpps: remove state from enum, since never used

We do not assign or use this particular state, so just remove it from
the enum. We continue anyway in the while loop in that case.

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
ring: don't care if we cannot active hw timestamping

Hw timestaming is currently done, if we have the header file from
the kernel available. If it fails, we currently bail out, which is
bullshit. Just returning is enough, since some users might have the
header available, but not a NIC supporting hw timestaming.

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
build: respect PREFIX_STRING on config file locations

When setting a prefix from the build system, also pass this through the
hard coded strings for config file locations in the toolkit, so that the
installed files (which use PREFIX) can be properly found.

Suggested-by: Peter Stuge <peter@stuge.se>
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>