af-packet: warn when tpacket_v3 is used in IPS

Update yaml and add an error message.
pull/2752/head
Eric Leblond 8 years ago committed by Victor Julien
parent ea9b9b5063
commit 050d8f788b

@ -264,11 +264,17 @@ static void *ParseAFPConfig(const char *iface)
iface, iface,
aconf->out_iface); aconf->out_iface);
aconf->copy_mode = AFP_COPY_MODE_IPS; aconf->copy_mode = AFP_COPY_MODE_IPS;
if (aconf->flags & AFP_TPACKET_V3) {
SCLogWarning(SC_ERR_RUNMODE, "Using tpacket_v3 in IPS mode will result in high latency");
}
} else if (strcmp(copymodestr, "tap") == 0) { } else if (strcmp(copymodestr, "tap") == 0) {
SCLogInfo("AF_PACKET TAP mode activated %s->%s", SCLogInfo("AF_PACKET TAP mode activated %s->%s",
iface, iface,
aconf->out_iface); aconf->out_iface);
aconf->copy_mode = AFP_COPY_MODE_TAP; aconf->copy_mode = AFP_COPY_MODE_TAP;
if (aconf->flags & AFP_TPACKET_V3) {
SCLogWarning(SC_ERR_RUNMODE, "Using tpacket_v3 in TAP mode will result in high latency");
}
} else { } else {
SCLogInfo("Invalid mode (not in tap, ips)"); SCLogInfo("Invalid mode (not in tap, ips)");
} }

@ -573,7 +573,8 @@ af-packet:
# Lock memory map to avoid it goes to swap. Be careful that over suscribing could lock # Lock memory map to avoid it goes to swap. Be careful that over suscribing could lock
# your system # your system
#mmap-locked: yes #mmap-locked: yes
# Use experimental tpacket_v3 capture mode, only active if use-mmap is true # Use tpacket_v3 capture mode, only active if use-mmap is true
# Don't use it in IPS or TAP mode as it causes severe latency
#tpacket-v3: yes #tpacket-v3: yes
# Ring size will be computed with respect to max_pending_packets and number # Ring size will be computed with respect to max_pending_packets and number
# of threads. You can set manually the ring size in number of packets by setting # of threads. You can set manually the ring size in number of packets by setting

Loading…
Cancel
Save