Mailing List Archive

Solaris and setsockopts
Hi, I'm having trouble with conserver on Solaris, I'm getting this in
the logfile:

[Thu Jun 3 07:00:28 2004] conserver (26279): ERROR: [test]
setsockopt(8,SO_KEEPALIVE): Invalid argument: forcing down


My version:
conserver: conserver.com version 8.1.7
conserver: default access type `r'
conserver: default escape sequence `^Ec'
conserver: default configuration in `/etc/conserver.cf'
conserver: default password in `/etc/conserver.passwd'
conserver: default logfile is `/var/log/conserver'
conserver: default pidfile is `/var/run/conserver.pid'
conserver: default limit is 16 members per group
conserver: default primary port referenced as `conserver'
conserver: default secondary base port referenced as `0'
conserver: options: openssl, pam
conserver: openssl version: OpenSSL 0.9.7d 17 Mar 2004
conserver: built with `./configure --prefix=/local --sysconfdir=/etc
--localstatedir=/var/run --with-pam --with-openssl'

I have the same configuration running faultless on Linux.

Any help ?


Sincerely,
Trond Hagen
Re: Solaris and setsockopts [ In reply to ]
On Thu, Jun 03, 2004 at 10:04:39AM +0200, Trond Hagen wrote:
> [Thu Jun 3 07:00:28 2004] conserver (26279): ERROR: [test]
> setsockopt(8,SO_KEEPALIVE): Invalid argument: forcing down

i bet you've compiled the thing as a 64bit app, right?

that's my guess...and when i tried that on my solaris box, i got the
same error. for some reason i'm using the wrong variable type on the
setsockopt() call (i think i got "confused" at one point a while
back...).

anyway, the fix is simple...apply this patch to conserver/consent.c:

*** consent.c.orig Thu Jun 3 12:22:09 2004
--- consent.c Thu Jun 3 12:22:17 2004
***************
*** 734,740 ****
{
struct sockaddr_in port;
struct hostent *hp;
! size_t one = 1;

usleep(100000); /* Not all terminal servers can keep up */

--- 734,740 ----
{
struct sockaddr_in port;
struct hostent *hp;
! int one = 1;

usleep(100000); /* Not all terminal servers can keep up */

that fixed it for me, at least. the other calls to setsockopt() in the
rest of the program use the correct type.

Bryan
Re: Solaris and setsockopts [ In reply to ]
On Thu, 2004-06-03 at 21:27, Bryan Stansell wrote:
> On Thu, Jun 03, 2004 at 10:04:39AM +0200, Trond Hagen wrote:
> > [Thu Jun 3 07:00:28 2004] conserver (26279): ERROR: [test]
> > setsockopt(8,SO_KEEPALIVE): Invalid argument: forcing down
>
> i bet you've compiled the thing as a 64bit app, right?

Yes.

>
> that's my guess...and when i tried that on my solaris box, i got the
> same error. for some reason i'm using the wrong variable type on the
> setsockopt() call (i think i got "confused" at one point a while
> back...).
>
> anyway, the fix is simple...apply this patch to conserver/consent.c:
>
> *** consent.c.orig Thu Jun 3 12:22:09 2004
> --- consent.c Thu Jun 3 12:22:17 2004
> ***************
> *** 734,740 ****
> {
> struct sockaddr_in port;
> struct hostent *hp;
> ! size_t one = 1;
>
> usleep(100000); /* Not all terminal servers can keep up */
>
> --- 734,740 ----
> {
> struct sockaddr_in port;
> struct hostent *hp;
> ! int one = 1;
>
> usleep(100000); /* Not all terminal servers can keep up */
>
> that fixed it for me, at least. the other calls to setsockopt() in the
> rest of the program use the correct type.

Your patch fixed it, thanks !

trond

>
> Bryan