This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: ioctl(SIOCGIFFLAGS) uses the interface address instead of name?


On Wed, 16 Oct 2002 15:09:24 +0200 (MEST),  Gilles Courcoux <Gilles.Courcoux@col.bsf.alcatel.fr> wrote:
> I would thus propose this modification to fhandler_socket.cc (change that
> shouldn't break applications relying on the until-now cygwin behavior) :
> 
> --- fhandler_socket.cc  Sat Jul  6 08:05:32 2002
> +++ fhandler_socket.cc.new      Thu Oct 10 19:05:33 2002
> @@ -996,7 +996,8 @@
>           return -1;
>         }
>        ifr->ifr_flags = IFF_NOTRAILERS | IFF_UP | IFF_RUNNING;
> -      if (ntohl (((struct sockaddr_in *) &ifr->ifr_addr)->sin_addr.s_addr)
> +      if ((! strncmp(ifr->ifr_name, "lo", 2))
> +         || ntohl (((struct sockaddr_in *) &ifr->ifr_addr)->sin_addr.s_addr)
>           == INADDR_LOOPBACK)
>         ifr->ifr_flags |= IFF_LOOPBACK;
>        else

Thanks for that patch!  Applied.

Corinna

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]