Mailing-List: contact cygwin-help@sourceware.cygnus.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@sources.redhat.com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin@sources.redhat.com>
List-Help: <mailto:cygwin-help@sources.redhat.com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner@sources.redhat.com
Delivered-To: mailing list cygwin@sources.redhat.com
Date: Tue, 15 May 2001 10:42:13 +0200
From: Corinna Vinschen <cygwin@cygwin.com>
To: cygwin@cygwin.com
Cc: tateyama@sanpo.t.u-tokyo.ac.jp
Subject: Re: your mail
Message-ID: <20010515104213.D31266@cygbert.vinschen.de>
Mail-Followup-To: cygwin@cygwin.com, tateyama@sanpo.t.u-tokyo.ac.jp
References: <200105150524.f4F5OxM15912@mail.sanpo.t.u-tokyo.ac.jp> <20010515013732.A25536@redhat.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/1.2.5i
In-Reply-To: <20010515013732.A25536@redhat.com>; from cygwin@cygwin.com on Tue, May 15, 2001 at 01:37:32AM -0400

> On Tue, May 15, 2001 at 02:24:59PM +0900, tateyama@sanpo.t.u-tokyo.ac.jp wrote:
> >Dear cygwin MAINTENERS,
> >
> >Please fix check routine that makes socket IFF_LOOPBACK flag wrong.
> >
> >				Yoshisuke TATEYAMA
> >== patch ================================================
> >*** cygwin/fhandler_socket.cc.orig	Sat May  5 12:55:00 2001
> >--- cygwin/fhandler_socket.cc	Tue May 15 13:45:58 2001
> >***************
> >*** 291,297 ****
> >  	  return -1;
> >  	}
> >        ifr->ifr_flags = IFF_NOTRAILERS | IFF_UP | IFF_RUNNING;
> >!       if (((struct sockaddr_in *) &ifr->ifr_addr)->sin_addr.s_addr
> >            == INADDR_LOOPBACK)
> >          ifr->ifr_flags |= IFF_LOOPBACK;
> >        else
> >--- 291,297 ----
> >  	  return -1;
> >  	}
> >        ifr->ifr_flags = IFF_NOTRAILERS | IFF_UP | IFF_RUNNING;
> >!       if (htonl(((struct sockaddr_in *) &ifr->ifr_addr)->sin_addr.s_addr)
> >            == INADDR_LOOPBACK)
> >          ifr->ifr_flags |= IFF_LOOPBACK;
> >        else
> >

Thanks for that patch. However, shouldn't that be `ntohl' and not
`htonl'? Reason: The sockaddr_in field has always to be filled using
network byte order. Therefore ioctl has to assume the above s_addr
field to be in network byte order so that it has to be converted to
host byte order (ntohl) before comparing with INADDR_LOOPBACK.
Ok, it's basically the same function but just for being correct...

I have applied the `ntohl' patch.

Thanks again,
Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Developer                                mailto:cygwin@cygwin.com
Red Hat, Inc.

--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple

