af-packet: improve xdp error handling

Don't try to bypass the flow if the flow table is unknown.

Also continue after error message if ever XDP was not correctly
setup.
pull/3221/head
Eric Leblond 8 years ago
parent 126488f74d
commit 1e729f059f

@ -479,7 +479,6 @@ static void *ParseAFPConfig(const char *iface)
if (ret != 0) { if (ret != 0) {
SCLogWarning(SC_ERR_INVALID_VALUE, SCLogWarning(SC_ERR_INVALID_VALUE,
"Error when setting up XDP"); "Error when setting up XDP");
/* FIXME error handling */
} }
} }
#else #else

@ -2262,10 +2262,14 @@ TmEcode AFPSetBPFFilter(AFPThreadVars *ptv)
*/ */
static int AFPInsertHalfFlow(int mapd, void *key, uint64_t inittime) static int AFPInsertHalfFlow(int mapd, void *key, uint64_t inittime)
{ {
/* FIXME error handling */
unsigned int nr_cpus = UtilCpuGetNumProcessorsConfigured(); unsigned int nr_cpus = UtilCpuGetNumProcessorsConfigured();
struct pair value[nr_cpus]; struct pair value[nr_cpus];
unsigned int i; unsigned int i;
if (mapd == -1) {
return 0;
}
for (i = 0; i < nr_cpus; i++) { for (i = 0; i < nr_cpus; i++) {
value[i].time = inittime; value[i].time = inittime;
value[i].packets = 0; value[i].packets = 0;

Loading…
Cancel
Save