PF_RING: force cluster type if vlan is disabled

If vlan is disabled the cluster_flow mode will still take VLAN tags
into account due to using pf_ring's 6-tuple mode.
So this forces to use pf_ring's 5-tuple mode.

Bug #1292
pull/1184/head
Giuseppe Longo 12 years ago committed by Victor Julien
parent 395d5b7f61
commit 2d43dae934

@ -521,6 +521,19 @@ TmEcode ReceivePfringThreadInit(ThreadVars *tv, void *initdata, void **data)
ptv->vlan_disabled = 1;
}
/* Since VLAN is disabled we force the cluster type to CLUSTER_FLOW_5_TUPLE */
if (ptv->vlan_disabled == 1 && ptv->ctype == CLUSTER_FLOW) {
SCLogInfo("VLAN disabled, setting cluster type to CLUSTER_FLOW_5_TUPLE");
rc = pfring_set_cluster(ptv->pd, ptv->cluster_id, CLUSTER_FLOW_5_TUPLE);
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;
}
}
*data = (void *)ptv;
pfconf->DerefFunc(pfconf);

@ -60,5 +60,5 @@ void PfringLoadConfig(void);
/* We don't have to use an enum that sucks in our code */
#define CLUSTER_FLOW 0
#define CLUSTER_ROUND_ROBIN 1
#define CLUSTER_FLOW_5_TUPLE 4
#endif /* __SOURCE_PFRING_H__ */

Loading…
Cancel
Save