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

(cherry picked from commit d4dd53c95f)
pull/9391/head
Shivani Bhardwaj 3 years ago committed by Shivani Bhardwaj
parent 9c90d01717
commit b46bccf357

@ -201,6 +201,11 @@ static void *ParseAFPConfig(const char *iface)
if (ConfGetChildValueWithDefault(if_root, if_default, "copy-iface", &out_iface) == 1) {
if (strlen(out_iface) > 0) {
aconf->out_iface = out_iface;
if (strcmp(iface, out_iface) == 0) {
FatalError(SC_ERR_FATAL,
"Invalid config: interface (%s) and copy-iface (%s) can't be the same",
iface, out_iface);
}
}
}

Loading…
Cancel
Save