delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/05/15/04:44:17

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
Date: Tue, 15 May 2001 10:42:13 +0200
From: Corinna Vinschen <cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Cc: tateyama AT sanpo DOT t DOT u-tokyo DOT ac DOT jp
Subject: Re: your mail
Message-ID: <20010515104213.D31266@cygbert.vinschen.de>
Mail-Followup-To: cygwin AT cygwin DOT com, tateyama AT sanpo DOT t DOT u-tokyo DOT ac DOT jp
References: <200105150524 DOT f4F5OxM15912 AT mail DOT sanpo DOT t DOT u-tokyo DOT ac DOT jp> <20010515013732 DOT A25536 AT redhat DOT com>
Mime-Version: 1.0
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 AT sanpo DOT t DOT u-tokyo DOT ac DOT 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 AT cygwin DOT com
Red Hat, Inc.

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019