Socket zero is a different problem, one that appears to mask the other.
Specifically, 0 is legal as a socket descriptor, but doesn't appear to be
used except under Fbsd. The code tests <=0...
Use this patch:
--- ntop/webInterface.c Thu Dec 16 21:15:43 2004
+++ ntop/webInterface.c Thu Dec 16 22:18:31 2004
@@ -8200,13 +8200,13 @@ void initSocket(int isSSL, int ipv4or6,
#else
*sock = socket(AF_INET, SOCK_STREAM, 0);
#endif
- if((*sock <= 0) || (errno != 0) ) {
+ if((*sock < 0) || (errno != 0) ) {
{
#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((*sock <= 0) || (errno != 0))
+ if((*sock < 0) || (errno != 0))
#endif
{
traceEvent(CONST_TRACE_FATALERROR, "INITWEB: Unable to create a
new%s socket - returned %d, error is '%s'(%d)",
====patchend====
-----Burton
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of
Stanley Hopcroft
Sent: Thursday, December 16, 2004 10:58 PM
To: [EMAIL PROTECTED]
Subject: Re: [Ntop] Re: 3.1 web server fails to respond on FBSD Was:
NtopCVSfails to compile on FreeBSD 4
Dear Sir,
I am writing to thank you for your letter and say,
On Thu, Dec 16, 2004 at 10:24:19PM -0600, Burton Strauss wrote:
> S:
.. snip
> Try this --
>
> After ./configure, edit config.h and look for #define INET6 1. Change
> that to #undef INET6.
>
I have already run configure so I didn't do say again (thinking that
configure will recreate config.h from config.h.in).
> Do the usual gmake and gmake install.
>
> When you start ntop, be sure and give a full -w specification, i.e. -w
> 192.168.x.x:3000
Ok. Unfortunately, I failed to understand Mr Buff's request to do that
formerly.
Result with -w a.b.c.d:3000 and #undef INET6 in config.h
Dec 17 15:51:47 pc09011 ntop[52172]: SSL is present but https is
disabled: use -W <https port> for enabling it
Dec 17 15:51:47 pc09011 ntop[52172]: INITWEB: Initializing web server
Dec 17 15:51:47 pc09011 ntop[52172]: INITWEB: Initializing tcp/ip
socket connections for web server
Dec 17 15:51:47 pc09011 ntop[52172]: INITWEB: Converted address
'a.b.c.d' - binding to the specific interface
Dec 17 15:51:47 pc09011 ntop[52172]: **FATAL_ERROR** INITWEB: Unable
to create a new socket - returned 0, error is 'Unknown error: 0'(0)
The result is the same when only the port is specified with -w.
Have I cocked it up ?
*** config.h.orig Fri Dec 17 15:38:12 2004
--- config.h Fri Dec 17 15:48:01 2004
***************
*** 641,647 ****
#define HAVE_ZLIB_H 1
/* Enable/disable ipv6 support */
! #define INET6 1
/* Define to 1 if `lstat' dereferences a symlink specified with a trailing
slash. */
--- 641,651 ----
#define HAVE_ZLIB_H 1
/* Enable/disable ipv6 support */
! #undef INET6
!
! /* #define INET6 1
! Mr Strauss's suggestion to deal with web server hang
! */
/* Define to 1 if `lstat' dereferences a symlink specified with a trailing
slash. */
The single homed host (fxp0) has INET6 support available but not built in
the kernel.
pc09011> ifconfig fxp0
fxp0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
inet a.b.c.d netmask 0xffffff00 broadcast a.b.c.255
ether 00:d0:b7:85:28:40
media: Ethernet autoselect (10baseT/UTP)
status: active
pc09011>
>
> It takes a LONG time for the 1st page to come up, but it seems ok
> after that.
>
> -----Burton
>
>
> -----Original Message-----
> On Thu, Dec 16, 2004 at 05:29:59PM -0800, Kurt Buff wrote:
>
> > What happens if you specify the ports with ip.add.re.ss:port pair?
> >
>
Yours sincerely.
--
Stanley Hopcroft
IP Australia
Ph: (02) 6283 3189 Fax: (02) 6281 1353
PO Box 200 Woden ACT 2606
http://www.ipaustralia.gov.au
_______________________________________________
Ntop mailing list
[EMAIL PROTECTED]
http://listgateway.unipi.it/mailman/listinfo/ntop