af-packet: make mmap options parsing conditional

Only parse them if mmap is activated.
pull/2091/head
Eric Leblond 10 years ago committed by Victor Julien
parent 7fea0ec6f9
commit 8035d83467

@ -227,13 +227,16 @@ void *ParseAFPConfig(const char *iface)
aconf->flags |= AFP_RING_MODE;
}
(void)ConfGetChildValueBoolWithDefault(if_root, if_default, "mmap-locked", (int *)&boolval);
if (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",
aconf->iface);
aconf->flags |= AFP_MMAP_LOCKED;
}
(void)ConfGetChildValueBoolWithDefault(if_root, if_default, "tpacket-v3", (int *)&boolval);
(void)ConfGetChildValueBoolWithDefault(if_root, if_default,
"tpacket-v3", (int *)&boolval);
if (boolval) {
if (strcasecmp(RunmodeGetActive(), "workers") == 0) {
#ifdef HAVE_TPACKET_V3
@ -251,12 +254,14 @@ void *ParseAFPConfig(const char *iface)
aconf->flags |= AFP_RING_MODE;
}
}
(void)ConfGetChildValueBoolWithDefault(if_root, if_default, "use-emergency-flush", (int *)&boolval);
(void)ConfGetChildValueBoolWithDefault(if_root, if_default,
"use-emergency-flush", (int *)&boolval);
if (boolval) {
SCLogInfo("Enabling ring emergency flush on iface %s",
aconf->iface);
aconf->flags |= AFP_EMERGENCY_MODE;
}
}
aconf->copy_mode = AFP_COPY_MODE_NONE;

Loading…
Cancel
Save