X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/53c1823aaef2eb8d547a8eed8cfe12fe7204ca79..f2b065fb2808b1c5c9243667530aa5dbb8eb85da:/projects/stargazer/plugins/capture/divert_freebsd/divert_cap.cpp?ds=inline

diff --git a/projects/stargazer/plugins/capture/divert_freebsd/divert_cap.cpp b/projects/stargazer/plugins/capture/divert_freebsd/divert_cap.cpp
index 5927727e..a949433e 100644
--- a/projects/stargazer/plugins/capture/divert_freebsd/divert_cap.cpp
+++ b/projects/stargazer/plugins/capture/divert_freebsd/divert_cap.cpp
@@ -45,7 +45,7 @@ $Date: 2010/09/10 06:43:03 $
 
 #include "stg/common.h"
 #include "stg/traffcounter.h"
-#include "sg/plugin_creator.h"
+#include "stg/plugin_creator.h"
 #include "divert_cap.h"
 
 #define BUFF_LEN (16384) /* max mtu -> lo=16436  TODO why?*/
@@ -54,7 +54,6 @@ $Date: 2010/09/10 06:43:03 $
 struct DIVERT_DATA {
 int sock;
 short int port;
-unsigned char buffer[BUFF_LEN];
 char iface[10];
 };
 //-----------------------------------------------------------------------------
@@ -150,7 +149,11 @@ return 0;
 //-----------------------------------------------------------------------------
 void * DIVERT_CAP::Run(void * d)
 {
-DIVERT_CAP * dc = (DIVERT_CAP *)d;
+sigset_t signalSet;
+sigfillset(&signalSet);
+pthread_sigmask(SIG_BLOCK, &signalSet, NULL);
+
+DIVERT_CAP * dc = static_cast<DIVERT_CAP *>(d);
 dc->isRunning = true;
 
 char buffer[64];
@@ -162,7 +165,7 @@ while (dc->nonstop)
     if (buffer[12] != 0x8)
         continue;
 
-    memcpy(rp.pckt, &buffer[14], pcktSize);
+    memcpy(rp.rawPacket.pckt, &buffer[14], pcktSize);
 
     dc->traffCnt->Process(rp);
     }