> From [EMAIL PROTECTED] Thu Apr 11 04:42:21 2002
> Date: Thu, 11 Apr 2002 12:45:56 +0200 (CEST)
> From: Villy Kruse <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> Subject: Re: LPRng: patch for 3.8.10 to compile on Solaris 2.6
>
> On Wed, 10 Apr 2002, Patrick Powell wrote:
>
> > Date: Wed, 10 Apr 2002 08:20:38 -0700 (PDT)
> > From: Patrick Powell <[EMAIL PROTECTED]>
> > Reply-To: [EMAIL PROTECTED]
> > To: [EMAIL PROTECTED]
> > Subject: Re: LPRng: patch for 3.8.10 to compile on Solaris 2.6
> >
> > Doh! Yes, you are quite correct, and get the
> > It's Obvious When You See It award...
> >
>
>
> I suggest you keep the 64bit test, though, as (unsigned long)0xffffffff
> won't be the same as (unsigned long)-1 when long is 64 bit which would
> be the resulting code if INADDR_NONE is not defined by the included
> system headers as one would expect it is supposed to be.
>
>
> What was the original problem again? I can't see there could
> have been any problem unless that Solaris 2.6 was compiling LPRng
> in 64 bit mode, and on Solaris, as far as I know, you can always
> compile this as a 32 bit executable and run it as such even on 64 bit
> hardware.
>
> Villy
I am going to keep the 'struct ... ' version of the patch.
#if !defined(INADDR_NONE)
#define INADDR_NONE 0xffffffff
#endif
if( inet_addr( strptr ) != INADDR_NONE ){
((struct in_addr *)addr)->s_addr = inet_addr(strptr);
return(1);
}
return(0);
#endif
See the man page:
BUGS
The value INADDR_NONE (0xffffffff) is a valid broadcast address, but
inet_addr() cannot return that value without indicating failure. The
newer inet_aton() function does not share this problem. The problem of
host byte ordering versus network byte ordering is confusing. The string
returned by inet_ntoa() resides in a static memory area.
Inet_addr should return a struct in_addr.
Patrick Powell Astart Technologies,
[EMAIL PROTECTED] 9475 Chesapeake Drive, Suite D,
Network and System San Diego, CA 92123
Consulting 858-874-6543 FAX 858-279-8424
LPRng - Print Spooler (http://www.lprng.com)
-----------------------------------------------------------------------------
YOU MUST BE A LIST MEMBER IN ORDER TO POST TO THE LPRNG MAILING LIST
The address you post from MUST be your subscription address
If you need help, send email to [EMAIL PROTECTED] (or lprng-requests
or lprng-digest-requests) with the word 'help' in the body. For the impatient,
to subscribe to a list with name LIST, send mail to [EMAIL PROTECTED]
with: | example:
subscribe LIST <mailaddr> | subscribe lprng-digest [EMAIL PROTECTED]
unsubscribe LIST <mailaddr> | unsubscribe lprng [EMAIL PROTECTED]
If you have major problems, send email to [EMAIL PROTECTED] with the word
LPRNGLIST in the SUBJECT line.
-----------------------------------------------------------------------------