die: minor: Remove trailing whitespace

Remove a trailing whitespace.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
conf: oui: run oui-update.py script to update OUI config file

Update OUI entries before release.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
netsniff-ng: Report if HW timestamping is enabled

Until now we didn't check the return value of set_sockopt_hwtimestamp()
and the Coverity scanner complained about it, so use it's return value
to report if timstamping is actually enabled in verbose mode.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
man: trafgen: fix remaining `` occurences

That's the last man page where `` occurs, so fix this up by making it
consistentlt '' as the rest of all man pages.

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
trafgen: fix -n1 bug for packet scheduling

In the current situation, it can happen when we set -n1, that no packet
at all will be scheduled. This is due to the case that nearbyint() will
for e.g. 2 cpus round to 0 each, and since in __correct_global_delta()
we only correct a total delta when a particular CPU is allowed to tx
packets (means already has a num > 0), then we correct the delta on the
first such CPU. Switch to using round(), so that on 0.5 it will be round
to the next higher int, and fix the check to >= 0 in __correct_global_delta()
so that a CPU could also get a 0 share of packets. I did a couple of tests
with different -n params and cpu(..) configs and this seems to fix that.

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
trafgen: check offsets for all kind of csums

It seems not critical at this point, but lets check it for all offsets
here as well, and mark this check as unlikely to happen.

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
trafgen: fix checksumming in trafgen example config

Took quite a while to git bisect the cause for the wrong TCP checksum
in the -e example. It turned out that commit bf43e1993c7037 ("trafgen:
lexer: return original string if no shellcode") "broke" it, since
before that commit the TCP checksum from -e example was correct and
afterwards not anymore. Well, it didn't break it. What was happening
here is that with this fix above, the packet got 1 byte longer since
the first character of the example string is not omitted anymore,
therefore the checksum got wrong. Fix this by fixing the IP total
length of the packet in the -e and man page example. The UDP example
from the man page still works well if csumudp() is used, so not
affected of this.

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
bpf: add missing decode for poff

When we decode BPF extensions, add the missing opcode for poff.
While at it, also remove the '#' prefix, since it's optional in
bpfc.

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
man: bpf: also mention that bpfc can be used for seccomp-BPF

Seccomp-BPF is used for syscall sandboxing. bpfc can also be used for
creating such filters without any problems.

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
man: bpfc: add example of loadable x86_64 seccomp-BPF filter

Add the example in bpfc code from http://outflux.net/teach-seccomp/
to the man page, so that people can also experiment with seccomp
bpf and to demonstrate that there are no limits on bpfc when it
comes to this. Actually this code is even more efficient than the
one given in the example URL above.

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
bpfc: stress that also seccomp-BPF can be generated with bpfc

Just add a minor sentence to help stating this.

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
docs: readme: also stress bpf seccomp in the README page

We should also make this clear from the beginning that one can use
bpfc for seccomps as well. Might be interesting for security
researchers to play around with.

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
bpf: very minor style fixups and paths marked unlikely

Mark some error paths as unlikely, and fixup some minor whitespace
issues. Nothing big to see here.

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
misc: remove two header comments

It's ridiculous to have a header comment here.

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
cpusched: cleanups, refactoring and fix one bug

Fix the bug in "if (!entry == 0 && errno == ENOENT)" and also do some
cleanups, make the code more readable and remove useless stuff. Used
in curvetun.

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
curve: rename encode/decode buffers

No need to prefix them with _buf, this just makes the names longer
and therefore less readable.

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
curve: simplify curve25519_proto_init and others

Simplify the function curve25519_proto_init() and also have minor
cleanups in other related ones.

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
curve: curve25519_encode/curve25519_decode: simplify crypto transforms

Simplify curve25519_encode() and curve25519_decode() transforms by making
the code more clear and by introducing macro accessors to nonces.

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
curve: fix crypto_box_beforenmbytes length

This seems to have been corrupted. Must be crypto_box_beforenmbytes.

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
curve: minor: fix up formatting

Just some minor whitespacing arrangements.

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>