Burton Strauss wrote:
> Socket zero is ugly.  In olden times, some calls used zero as an error
> return.  It's actually legal, but some OSes avoid it and others allow it.
> 
> There are still some places in the code where we erroneously test for >0 vs.
> 
>>=0.
> 
> 
> It's been fixed in the cvs, the test is now (*sock < 0).  (webInterface.c
> around line 8220)
> 
> -----Burton
> 
> 
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of
> Preston Kutzner
> Sent: Thursday, August 11, 2005 10:31 AM
> To: [email protected]
> Subject: [Ntop] Can't get NTOP to start on Trustix 3.0
> 
> Hello list,
> 
> I've recently compiled and installed NTOP 3.1 on a Trustix 3.0 box.  I'm
> running the latest Shorewall (v2.5.0) as well.  When I start NTOP, I get
> the following in my /var/log/messages:
> 
> Aug 11 10:15:22 arcturus ntop[28276]:   ntop v.3.1 MT (SSL)
> Aug 11 10:15:22 arcturus ntop[28276]:   Configured on Aug 11 2005 
> 9:32:40, built on Aug 11 2005 09:48:59.
> Aug 11 10:15:22 arcturus ntop[28276]:   Copyright 1998-2004 by Luca Deri
> <[EMAIL PROTECTED]>
> Aug 11 10:15:22 arcturus ntop[28276]:   Get the freshest ntop from
> http://www.ntop.org/
> Aug 11 10:15:22 arcturus ntop[28276]:   Initializing ntop
> Aug 11 10:15:22 arcturus kernel: eth0: Setting promiscuous mode.
> Aug 11 10:15:22 arcturus kernel: device eth0 entered promiscuous mode
> Aug 11 10:15:22 arcturus ntop[28276]:   Checking eth0 for additional devices
> Aug 11 10:15:22 arcturus ntop[28276]:   Resetting traffic statistics for
> device eth0
> Aug 11 10:15:22 arcturus ntop[28276]:   DLT: Device 0 [eth0] is 1, mtu
> 1514, header 14
> Aug 11 10:15:22 arcturus kernel: eth1: Setting promiscuous mode.
> Aug 11 10:15:22 arcturus kernel: device eth1 entered promiscuous mode
> Aug 11 10:15:22 arcturus ntop[28276]:   Checking eth1 for additional devices
> Aug 11 10:15:22 arcturus ntop[28276]:   Resetting traffic statistics for
> device eth1
> Aug 11 10:15:22 arcturus ntop[28276]:   DLT: Device 1 [eth1] is 1, mtu
> 1514, header 14
> Aug 11 10:15:22 arcturus kernel: eth2: Setting promiscuous mode.
> Aug 11 10:15:22 arcturus kernel: device eth2 entered promiscuous mode
> Aug 11 10:15:22 arcturus ntop[28276]:   Checking eth2 for additional devices
> Aug 11 10:15:22 arcturus ntop[28276]:   Resetting traffic statistics for
> device eth2
> Aug 11 10:15:22 arcturus ntop[28276]:   DLT: Device 2 [eth2] is 1, mtu
> 1514, header 14
> Aug 11 10:15:22 arcturus ntop[28276]:   Initializing gdbm databases
> Aug 11 10:15:22 arcturus ntop[28276]:   VENDOR: Loading MAC address table.
> Aug 11 10:15:22 arcturus ntop[28276]:   VENDOR: Checking for MAC address
> table file
> Aug 11 10:15:22 arcturus ntop[28276]:   VENDOR: File
> './specialMAC.txt.gz' does not need to be reloaded
> Aug 11 10:15:22 arcturus ntop[28276]:   VENDOR: ntop continues ok
> Aug 11 10:15:22 arcturus ntop[28276]:   VENDOR: Checking for MAC address
> table file
> Aug 11 10:15:22 arcturus ntop[28276]:   VENDOR: File './oui.txt.gz' does
> not need to be reloaded
> Aug 11 10:15:22 arcturus ntop[28276]:   VENDOR: ntop continues ok
> Aug 11 10:15:22 arcturus ntop[28276]:   Fingeprint: Loading signature file.
> Aug 11 10:15:22 arcturus ntop[28276]:   Fingeprint: ...loaded 1697 records
> Aug 11 10:15:22 arcturus ntop[28277]:   INIT: Bye bye: I'm becoming a
> daemon...
> Aug 11 10:15:22 arcturus ntop[28276]:   INIT: Parent process is exiting
> (this is normal)
> Aug 11 10:15:22 arcturus ntop[28277]:   Now running as a daemon
> Aug 11 10:15:22 arcturus ntop[28277]:   ASN: Checking for Autonomous
> System Number table file
> Aug 11 10:15:22 arcturus ntop[28277]:   **WARNING** ASN: Unable to open
> file 'AS-list.txt'
> Aug 11 10:15:22 arcturus ntop[28277]:   I18N: This instance of ntop does
> not support multiple languages
> Aug 11 10:15:22 arcturus ntop[28277]:   IP2CC: Checking for IP address
> <-> Country Code mapping file
> Aug 11 10:15:22 arcturus ntop[28277]:   IP2CC: Loading file
> '/usr/local/etc/ntop/p2c.opt.table.gz'
> Aug 11 10:15:23 arcturus ntop[28277]:   IP2CC: ...found 52395 lines
> Aug 11 10:15:23 arcturus ntop[28277]:   GDVERCHK: Guessing at libgd version
> Aug 11 10:15:23 arcturus ntop[28277]:   GDVERCHK: ... as 2.0.21+
> Aug 11 10:15:23 arcturus ntop[28277]:   Initializing external applications
> Aug 11 10:15:23 arcturus ntop[28277]:   THREADMGMT: Started thread
> (-1237148720) for network packet analyser
> Aug 11 10:15:23 arcturus ntop[28277]:   THREADMGMT: Started thread
> (-1245537328) for fingerprinting
> Aug 11 10:15:23 arcturus ntop[28277]:   THREADMGMT: Started thread
> (-1253925936) for idle hosts detection
> Aug 11 10:15:23 arcturus ntop[28277]:   THREADMGMT: Started thread
> (-1262314544) for DNS address resolution
> Aug 11 10:15:23 arcturus ntop[28277]:   Calling plugin start functions
> (if any)
> Aug 11 10:15:23 arcturus ntop[28277]:   SSL: Initializing...
> Aug 11 10:15:23 arcturus ntop[28277]:   SSL_PRNG: Automatically initialized!
> Aug 11 10:15:23 arcturus ntop[28277]:   SSL initialized successfully
> Aug 11 10:15:23 arcturus ntop[28277]:   INITWEB: Initializing web server
> Aug 11 10:15:23 arcturus ntop[28277]:   INITWEB: Initializing tcp/ip
> socket connections for web server
> Aug 11 10:15:24 arcturus ntop[28277]:   **FATAL_ERROR** INITWEB: Unable
> to create a new socket - returned 0, error is 'Success'(0)
> Aug 11 10:15:24 arcturus kernel: device eth0 left promiscuous mode
> Aug 11 10:15:24 arcturus kernel: device eth1 left promiscuous mode
> Aug 11 10:15:24 arcturus kernel: device eth2 left promiscuous mode
> 
> I'm not sure what's going on here, as the error it gets during INITWEB
> appears to be "Success" but it is still bombing out.  Can anyone point
> me in the right direction as to why it would not be able to create a
> socket?  Thanks.
> 
> _______________________________________________
> Ntop mailing list
> [email protected]
> http://listgateway.unipi.it/mailman/listinfo/ntop
> 
> 

OK, so here's what I have in the source around that line number:

 /* socket 0 should be legal everywhere, but it's late in the release
cycle to be making this type of change.
  *   So - FOR NOW - special case this here and below.  Post 3.1, test
this and make it general!
  * -----Burton
  */
 #if defined(__FreeBSD__)
    if((*sock < 0) || (errno != 0) ) {
 #else
    if((*sock <= 0) || (errno != 0) ) {
 #endif
      {
#if defined(INET6) && !defined(WIN32)
        errno = 0;
        /* It might be that IPv6 is not supported by the running system */
        *sock = socket(AF_INET, SOCK_STREAM, 0);
 #if defined(__FreeBSD__)
        if((*sock < 0) || (errno != 0))
 #else
        if((*sock <= 0) || (errno != 0))
 #endif
#endif

What do I need to change to make this work?  (I don't want to have to
fool around with CVS if possible.)

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
Ntop mailing list
[email protected]
http://listgateway.unipi.it/mailman/listinfo/ntop

Reply via email to