af-packet: use mmap capture by default

Update the code to use mmap capture by default even in unset in
configuration file. mmap capture is now be turned off by using
explicitely 'use-mmap: no' in configuration.
pull/2091/head
Eric Leblond 9 years ago committed by Victor Julien
parent c2d0d93806
commit 876b356bbe

@ -216,12 +216,17 @@ void *ParseAFPConfig(const char *iface)
}
}
(void)ConfGetChildValueBoolWithDefault(if_root, if_default, "use-mmap", (int *)&boolval);
if (boolval) {
SCLogInfo("Enabling mmaped capture on iface %s",
aconf->iface);
if (ConfGetChildValueBoolWithDefault(if_root, if_default, "use-mmap", (int *)&boolval) == 1) {
if (boolval) {
aconf->flags |= AFP_RING_MODE;
} else {
SCLogInfo("Disabling mmaped capture on iface %s",
aconf->iface);
}
} else {
aconf->flags |= AFP_RING_MODE;
}
(void)ConfGetChildValueBoolWithDefault(if_root, if_default, "mmap-locked", (int *)&boolval);
if (boolval) {
SCLogInfo("Enabling locked memory for mmap on iface %s",

@ -525,7 +525,7 @@ af-packet:
# Put default values here
- interface: default
#threads: auto
#use-mmap: yes
#use-mmap: no
#rollover: yes
tpacket-v3: yes

Loading…
Cancel
Save