On Sun, 7 Apr 2002, Patrick Powell wrote:

> > > 
> > > --- LPRng-3.8.10/src/common/linksupport.c       Mon Apr  1 19:54:51 2002
> > > +++ LPRng-3.8.10-patched/src/common/linksupport.c       Sat Apr  6 12:55:14 2002
> > > @@ -1462,7 +1462,7 @@
> > >  #if !defined(INADDR_NONE)
> > >  #define INADDR_NONE (-1)
> > >  #endif
> > > -       if( inet_addr( strptr ) != INADDR_NONE ){
> > > +       if( inet_addr( strptr ) != (in_addr_t)INADDR_NONE ){
> > >                 ((unsigned long *)addr)[0] = inet_addr( strptr );
> > >                 return(1);
> > >         }
> > > 
> >
> 
>       {
>               unsigned long t = inet_addr( strptr );
>               if( sizeof(t) != 4 ){
>                       Errorcode = JABORT;
>                       FATAL(LOG_ERR) "inet_pton:  PORTABILITY PROBLEM - legacy 
>support assumes sizeof(long) == 4, and it is %d",
>                               sizeof(t) );
>               }
>               if( t != (unsigned long)INADDR_NONE ){
>                       ((unsigned long *)addr)[0] = t;
>                       return(1);
>               }
>       }
> 


Perhaps the following is closer to the intent, when addr is realy
pointing to an in_addr structure (at least for IPv4 addresses).

--- linksupport.c.orig  Sat Feb  9 04:37:32 2002
+++ linksupport.c       Mon Apr  8 10:12:11 2002
@@ -1449,31 +1449,31 @@
  int inet_pton( int family, const char *strptr, void *addr )
 {
        if( family != AF_INET ){
                FATAL(LOG_ERR) "inet_pton: bad family '%d'", family );
        }
 #if defined(HAVE_INET_ATON)
        return( inet_aton( strptr, addr ) );
 #else
 #if !defined(INADDR_NONE)
 #define INADDR_NONE (-1)
 #endif
        if( inet_addr( strptr ) != INADDR_NONE ){
-               ((unsigned long *)addr)[0] = inet_addr( strptr );
+               ((struct in_addr *)addr)->s_addr = inet_addr( strptr );
                return(1);
        }
        return(0);
 #endif
 }
 


Villy


-----------------------------------------------------------------------------
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.
-----------------------------------------------------------------------------

Reply via email to