Hi Fabrice,
many thanks from the whole ntop community. You definitively found a bug.
Your patch has been included in the ntop CVS source tree.
Cheers, Luca
Fabrice Bellet wrote:
>
> Hello,
>
> I think I fixed the MT-safety problem : a releaseMutex()
> was missing in processPacket() when returning before the
> end of the critical section. Here is the patch :
>
> Index: ntop.h
> ===================================================================
> RCS file: /home/ntop/ntop/ntop.h,v
> retrieving revision 1.21
> diff -u -r1.21 ntop.h
> --- ntop.h 2000/10/18 12:48:00 1.21
> +++ ntop.h 2000/10/25 22:05:19
> @@ -204,6 +204,7 @@
>
> #if defined(HAVE_SEMAPHORE_H)
> # include <semaphore.h>
> +# define USE_SEMAPHORES 1
> #else
> # undef USE_SEMAPHORES
> #endif
> Index: pbuf.c
> ===================================================================
> RCS file: /home/ntop/ntop/pbuf.c,v
> retrieving revision 1.17
> diff -u -r1.17 pbuf.c
> --- pbuf.c 2000/10/25 11:51:05 1.17
> +++ pbuf.c 2000/10/25 22:05:20
> @@ -2850,6 +2850,9 @@
> if(EXTRACT_16BITS(&llc.ethertype[0]) == ETHERTYPE_IP) {
> /* encapsulated IP packet */
> processIpPkt(p, h, length, ether_src, ether_dst);
> +#ifdef MULTITHREADED
> + releaseMutex(&hostsHashMutex);
> +#endif
> return;
> }
> }
>
> intop now happily filters over 1Gb IP packets without crashing.
>
> bye,
> Fabrice
--
Luca Deri Finsiel S.p.A.
Via Matteucci 34/B 56124 Pisa, Italy.
Ph. +39/050/968.639 Fax. +39/050/968.626
Email: [EMAIL PROTECTED] WWW: http://www.tlcpi.finsiel.it/~deri/
ICQ: 68183632
Software is about stuff, about getting hands dirty - Jim Coplien