net: bpf: fix off by one in seccomp_choose

We were off by one when iterating through states, so simply fix
that by choosing the correct max limit.

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
ETH_P_802_3_MIN back compat.
configure.sh: use colors only with terminal

The color codes mess up less and log files.

Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
configure.sh: use gcc as default compiler

Cross compilers might not have cc symlink but do have gcc.

Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
configure.sh: expand tilde from CROSS_COMPILE variable

Users can define cross compiler paths like
CROSS_COMPILE="ccache ~/bin/arm/bin/..." and would like this to work.

Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
Makefile: use gcc as compiler

Cross compilers might not have cc symlink to gcc.

Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
Makefile: support sysroot for libs and includes

Helps with cross compilation when correct lib and include files
are used.

Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
Define IP_MULTICAST_ALL if header files don't have it

Older systems have it defined in <linux/in.h> which conflicts with
<netinet/in.h>.

Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
net/irda_setsockopt.c: workaround for old irda headers

Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
net/netlink.c: support older kernels and headers

Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
net/netlink_setsockopt.c: workaround for old headers

Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
Makefile: install depends on trinity target

After this 'make install' just works.

Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
compat.h: Add if_ether.h symbols for older kernels.

This patch fixes these build errors on CentOS 6.

  CC	net/ether.o
net/ether.c:12: error: ‘ETH_P_BATMAN’ undeclared here (not in a function)
net/ether.c:19: error: ‘ETH_P_LINK_CTL’ undeclared here (not in a function)
net/ether.c:21: error: ‘ETH_P_8021AD’ undeclared here (not in a function)
net/ether.c:21: error: ‘ETH_P_802_EX1’ undeclared here (not in a function)
net/ether.c:22: error: ‘ETH_P_8021AH’ undeclared here (not in a function)
net/ether.c:22: error: ‘ETH_P_MVRP’ undeclared here (not in a function)
net/ether.c:23: error: ‘ETH_P_QINQ1’ undeclared here (not in a function)
net/ether.c:24: error: ‘ETH_P_QINQ2’ undeclared here (not in a function)
net/ether.c:24: error: ‘ETH_P_QINQ3’ undeclared here (not in a function)
net/ether.c:31: error: ‘ETH_P_CANFD’ undeclared here (not in a function)
net/ether.c:34: error: ‘ETH_P_CAIF’ undeclared here (not in a function)

Signed-off-by: Vinson Lee <vlee@twitter.com>
Add missing NETLINK_RX_RING, NETLINK_TX_RING definitions.
use a trinity child pid for the netlink pid
use rand32 for netlink groups.
jump back to child after getting SIGALRM

This should work better now, so we should be able to jump directly back into
the same child and just do a different syscall.
flush previous syscall output when we get SIGALRM
fix accounting so it counts syscalls before we do the syscall.

Otherwise when we jump back after sigalrm, we don't increment the counters.
hush some noise if we're running with -q