From cdbc9be1c3b67c6ca98e6ede8a2a07efa3c669b7 Mon Sep 17 00:00:00 2001 From: Eric Leblond Date: Fri, 14 Sep 2012 18:06:37 +0200 Subject: [PATCH] pf_ring: set cluster_id even if only one thread is used. --- src/source-pfring.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/source-pfring.c b/src/source-pfring.c index f90feebd9b..fc35003dca 100644 --- a/src/source-pfring.c +++ b/src/source-pfring.c @@ -370,30 +370,30 @@ TmEcode ReceivePfringThreadInit(ThreadVars *tv, void *initdata, void **data) { /* We only set cluster info if the number of pfring threads is greater than 1 */ ptv->threads = pfconf->threads; - if (ptv->threads > 1) { - ptv->cluster_id = pfconf->cluster_id; + ptv->cluster_id = pfconf->cluster_id; #ifdef HAVE_PFRING_CLUSTER_TYPE - ptv->ctype = pfconf->ctype; - rc = pfring_set_cluster(ptv->pd, ptv->cluster_id, ptv->ctype); + ptv->ctype = pfconf->ctype; + rc = pfring_set_cluster(ptv->pd, ptv->cluster_id, ptv->ctype); #else - rc = pfring_set_cluster(ptv->pd, ptv->cluster_id); + rc = pfring_set_cluster(ptv->pd, ptv->cluster_id); #endif /* HAVE_PFRING_CLUSTER_TYPE */ - if (rc != 0) { - SCLogError(SC_ERR_PF_RING_SET_CLUSTER_FAILED, "pfring_set_cluster " - "returned %d for cluster-id: %d", rc, ptv->cluster_id); - pfconf->DerefFunc(pfconf); - return TM_ECODE_FAILED; - } + if (rc != 0) { + SCLogError(SC_ERR_PF_RING_SET_CLUSTER_FAILED, "pfring_set_cluster " + "returned %d for cluster-id: %d", rc, ptv->cluster_id); + pfconf->DerefFunc(pfconf); + return TM_ECODE_FAILED; + } + + if (ptv->threads > 1) { SCLogInfo("(%s) Using PF_RING v.%d.%d.%d, interface %s, cluster-id %d", tv->name, (version & 0xFFFF0000) >> 16, (version & 0x0000FF00) >> 8, version & 0x000000FF, ptv->interface, ptv->cluster_id); - } else { - SCLogInfo("(%s) Using PF_RING v.%d.%d.%d, interface %s, single-pfring-thread", + SCLogInfo("(%s) Using PF_RING v.%d.%d.%d, interface %s, cluster-id %d, single-pfring-thread", tv->name, (version & 0xFFFF0000) >> 16, (version & 0x0000FF00) >> 8, - version & 0x000000FF, ptv->interface); + version & 0x000000FF, ptv->interface, ptv->cluster_id); } #ifdef HAVE_PFRING_SET_BPF_FILTER