/* if the number of threads is not 1, we need to first check if fanout
* functions on this system. */
if (aconf->threads != 1) {
- if (AFPIsFanoutSupported() == 0) {
+ if (AFPIsFanoutSupported(aconf->cluster_id) == 0) {
if (aconf->threads != 0) {
SCLogNotice("fanout not supported on this system, falling "
"back to 1 capture thread");
/** \brief test if we can use FANOUT. Older kernels like those in
* CentOS6 have HAVE_PACKET_FANOUT defined but fail to work
*/
-int AFPIsFanoutSupported(void)
+int AFPIsFanoutSupported(int cluster_id)
{
#ifdef HAVE_PACKET_FANOUT
int fd = socket(AF_PACKET, SOCK_RAW, htons(ETH_P_ALL));
close(fd);
if (r < 0) {
- SCLogPerf("fanout not supported by kernel: %s", strerror(errno));
+ SCLogError(SC_ERR_INVALID_VALUE, "fanout not supported by kernel: "
+ "Kernel too old or cluster-id %d already in use.", cluster_id);
return 0;
}
return 1;
void AFPPeersListClean(void);
int AFPGetLinkType(const char *ifname);
-int AFPIsFanoutSupported(void);
+int AFPIsFanoutSupported(int cluster_id);
+
#endif /* __SOURCE_AFP_H__ */