}
}
+static int PostDeviceFinalizedSetup(SCInstance *suri)
+{
+ SCEnter();
+
+#ifdef HAVE_AF_PACKET
+ if (suri->run_mode == RUNMODE_AFP_DEV) {
+ if (AFPRunModeIsIPS()) {
+ SCLogInfo("AF_PACKET: Setting IPS mode");
+ EngineModeSetIPS();
+ }
+ }
+#endif
+#ifdef HAVE_NETMAP
+ if (suri->run_mode == RUNMODE_NETMAP) {
+ if (NetmapRunModeIsIPS()) {
+ SCLogInfo("Netmap: Setting IPS mode");
+ EngineModeSetIPS();
+ }
+ }
+#endif
+
+ SCReturnInt(TM_ECODE_OK);
+}
+
/**
* This function is meant to contain code that needs
* to be run once the configuration has been loaded.
PreRunInit(suri->run_mode);
- SCReturnInt(TM_ECODE_OK);
-}
-
-static int PostDeviceFinalizedSetup(SCInstance *suri)
-{
- SCEnter();
+ LiveDeviceFinalize();
-#ifdef HAVE_AF_PACKET
- if (suri->run_mode == RUNMODE_AFP_DEV) {
- if (AFPRunModeIsIPS()) {
- SCLogInfo("AF_PACKET: Setting IPS mode");
- EngineModeSetIPS();
- }
- }
-#endif
-#ifdef HAVE_NETMAP
- if (suri->run_mode == RUNMODE_NETMAP) {
- if (NetmapRunModeIsIPS()) {
- SCLogInfo("Netmap: Setting IPS mode");
- EngineModeSetIPS();
- }
+ if (PostDeviceFinalizedSetup(&suricata) != TM_ECODE_OK) {
+ exit(EXIT_FAILURE);
}
-#endif
SCReturnInt(TM_ECODE_OK);
}
exit(EXIT_FAILURE);
}
- LiveDeviceFinalize();
-
- if (PostDeviceFinalizedSetup(&suricata) != TM_ECODE_OK) {
- exit(EXIT_FAILURE);
- }
-
SCDropMainThreadCaps(suricata.userid, suricata.groupid);
PreRunPostPrivsDropInit(suricata.run_mode);