Cannot Stop Argus when There is No traffic and Source is not Selectable
Carter Bullard
carter at qosient.com
Wed Aug 12 13:44:52 EDT 2015
Hey Ming !!!
Thanks and thanks for the suggested fix !!!
We have 3.0.8.2 almost ready to go, with the latest mods for some IPv6 ICMP bugs, and I'll put this, or something like this, in before we officially release !!!
Thanks again !!
Carter
> On Aug 12, 2015, at 1:26 PM, MING FU <fuming188 at yahoo.ca> wrote:
>
> Hi Carter,
>
> The Argus falls to shutdown when the source traffic is from none selectable source and there is no new traffic. The shutdown signal is received by the main thread. However, all the source thread were waiting on the recv() of new packet. If there is no new packets to receive, the threads sleep on recv() do not know that shutdown is required and ArgusShutDownFlag is set.
>
> The main thread need to check the check for the ArgusShutDownFlag and pthread_cancel the threads.
>
> The following patch to seems to fix the problem.
> ===========================================
>
> --- ../../dist-plain/argus/ArgusSource.c 2015-08-10 19:51:27.000000000 +0000
> +++ ArgusSource.c 2015-08-12 16:54:36.000000000 +0000
> @@ -72,6 +72,8 @@
> #define PPP_HDRLEN 4 /* length of PPP header */
> #endif
>
> +extern int ArgusShutDownFlag;
> +
> void ArgusGetInterfaceStatus (struct ArgusSourceStruct *src);
> void setArgusPcapBufSize (struct ArgusSourceStruct *, int);
>
> @@ -3813,9 +3815,11 @@
>
> for (i = 0; i < ArgusThreadCount; i++) {
> gettimeofday (&stask->srcs[i]->marktime, 0L);
> - if (stask->srcs[i]->status & ARGUS_SHUTDOWN) {
> + if (stask->srcs[i]->status & ARGUS_SHUTDOWN || ArgusShutDownFlag) {
> pthread_t thread;
> void *ptr = NULL;
> + if ( ArgusShutDownFlag )
> + pthread_cancel(thread);
> if ((thread = stask->srcs[i]->thread) != 0)
> pthread_join(thread, &ptr);
>
>
> Regards,
> Ming
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist1.pair.net/pipermail/argus/attachments/20150812/8eb69f44/attachment.html>
More information about the argus
mailing list