char *tmpclusterid;
char *tmpctype;
intmax_t value;
- int dispromisc;
+ int boolval;
if (iface == NULL) {
return NULL;
aconf->cluster_id = 1;
aconf->cluster_type = PACKET_FANOUT_HASH;
aconf->promisc = 1;
+ aconf->detect_offload = 1;
aconf->DerefFunc = AFPDerefConfig;
/* Find initial node */
aconf->buffer_size = 0;
}
- ConfGetChildValueBool(if_root, "disable-promisc", (int *)&dispromisc);
- if (dispromisc) {
+ ConfGetChildValueBool(if_root, "disable-promisc", (int *)&boolval);
+ if (boolval) {
SCLogInfo("Disabling promiscuous mode on iface %s",
aconf->iface);
aconf->promisc = 0;
}
+ ConfGetChildValueBool(if_root, "detect-offload", (int *)&boolval);
+ if (! boolval) {
+ SCLogInfo("Disabling checksum offloading detection for %s",
+ aconf->iface);
+ aconf->detect_offload = 0;
+ }
+
+
return aconf;
}
/* socket buffer size */
int buffer_size;
int promisc;
+ int detect_offload;
int cluster_id;
int cluster_type;
}
}
-{ int val = 1;
- if (setsockopt(ptv->socket, SOL_PACKET, PACKET_AUXDATA, &val,
- sizeof(val)) == -1 && errno != ENOPROTOOPT) {
-/* FIXME */
- return -1;
+ if (ptv->detect_offload) {
+ int val = 1;
+ if (setsockopt(ptv->socket, SOL_PACKET, PACKET_AUXDATA, &val,
+ sizeof(val)) == -1 && errno != ENOPROTOOPT) {
+ SCLogError(SC_ERR_AFP_CREATE,
+ "Couldn't active auxdata on iface %s, error %s",
+ devname,
+ strerror(errno));
+ close(ptv->socket);
+ return -1;
+ }
}
-}
/* set socket recv buffer size */
if (ptv->buffer_size != 0) {
ptv->buffer_size = afpconfig->buffer_size;
ptv->promisc = afpconfig->promisc;
+ ptv->detect_offload = afpconfig->detect_offload;
ptv->threads = 1;
#ifdef HAVE_PACKET_FANOUT
int cluster_type;
/* promisc mode */
int promisc;
+ /* no local packet */
+ int detect_offload;
SC_ATOMIC_DECLARE(unsigned int, ref);
void (*DerefFunc)(void *);
} AFPIfaceConfig;
# buffer-size: 32768
# Set to yes to disable promiscuous mode
# disable-promisc: no
+ # If your IDS do not treat any transmitted packets, you can set
+ # the following variable to no.
+ # detect-offload: yes
- interface: eth1
threads: 1
cluster-id: 98