This is the mail archive of the cygwin-developers@sourceware.cygnus.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]

patch to net.cc (get_if_flags) [Fwd: ioctl() SOS -- Please help]


Corinna Vinschen wrote:
> 
> Corinna Vinschen wrote:
> >
> > "Ashish C. Nagre" wrote:
> > > I have made a strange observation, when the following call is made:
> > > [...]
> > In case of address 0.0.0.0, the cygwin DLL knows, that the interface
> > isn't connected and so returns the flags
> >         IFF_NOTRAILERS | IFF_BROADCAST
> > The hex value of the above flags is 0x34.
> 
> Oops, this isn't correct, is it? I have checked it on linux. The
> ppp interfaces, which are not connected are nevertheless up and
> running!
> 
> I will patch it ASAP.

This dumb change was originaly contributed by me in December :-(
Sigh! Here's the correction.

Corinna


ChangeLog:
==========

Fri May 28 21:10:33 1999  Corinna Vinschen  <corinna@vinschen.de>

	* net.cc (get_if_flags): Change the UP and RUNNING state
	of disconnected RAS interfaces to true.

Index: net.cc
===================================================================
RCS file: /src/cvsroot/winsup-990526/net.cc,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 net.cc
--- net.cc      1999/05/28 19:27:54     1.1.1.1
+++ net.cc      1999/06/01 22:24:56
@@ -1455,15 +1455,13 @@ get_ifconf (struct ifconf *ifc, int what
 static int
 get_if_flags (struct ifreq *ifr)
 {
-  short flags = IFF_NOTRAILERS;
   struct sockaddr_in *sa = (struct sockaddr_in *) &ifr->ifr_addr;

-  if (sa->sin_addr.s_addr == INADDR_ANY)
-      flags |= IFF_BROADCAST;
-  else if (sa->sin_addr.s_addr == INADDR_LOOPBACK)
-      flags |= IFF_LOOPBACK | IFF_UP | IFF_RUNNING;
+  short flags = IFF_NOTRAILERS | IFF_UP | IFF_RUNNING;
+  if (sa->sin_addr.s_addr == INADDR_LOOPBACK)
+      flags |= IFF_LOOPBACK;
   else
-      flags |= IFF_BROADCAST | IFF_UP | IFF_RUNNING;
+      flags |= IFF_BROADCAST;

   ifr->ifr_flags = flags;
   return 0;

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