your mail

Corinna Vinschen cygwin@cygwin.com
Tue May 15 01:42:00 GMT 2001


> 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


More information about the Cygwin mailing list

AltStyle によって変換されたページ (->オリジナル) /