From d4dd53c95f5fe30a0b2a1e71ab185c06c71a1afe Mon Sep 17 00:00:00 2001 From: Shivani Bhardwaj Date: Thu, 10 Aug 2023 17:47:35 +0530 Subject: [PATCH] af-packet: terminate on same interface & copyiface If the interface and copy-iface are same for an af-packet IPS device setting then fataly exit else it leads to a segfault in later stages. Bug 5870 --- src/runmode-af-packet.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/runmode-af-packet.c b/src/runmode-af-packet.c index fff1bd45b9..fd21c26293 100644 --- a/src/runmode-af-packet.c +++ b/src/runmode-af-packet.c @@ -290,6 +290,11 @@ static void *ParseAFPConfig(const char *iface) if (out_iface != NULL) { if (strlen(out_iface) > 0) { aconf->out_iface = out_iface; + if (strcmp(iface, out_iface) == 0) { + FatalError( + "Invalid config: interface (%s) and copy-iface (%s) can't be the same", + iface, out_iface); + } } } else { SCLogWarning("copy-iface corresponding to %s interface cannot be NULL", iface); -- 2.47.2