You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by hi...@apache.org on 2007/10/08 12:24:57 UTC
svn commit: r582766 -
/harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/unix/hysock.c
Author: hindessm
Date: Mon Oct 8 03:24:50 2007
New Revision: 582766
URL: http://svn.apache.org/viewvc?rev=582766&view=rev
Log:
Fix code that has been "accidentally" working (because IFF_UP happens
to be 1 so "(flags & ( 1 == 1))" does what the author intended).
Modified:
harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/unix/hysock.c
Modified: harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/unix/hysock.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/unix/hysock.c?rev=582766&r1=582765&r2=582766&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/unix/hysock.c (original)
+++ harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/unix/hysock.c Mon Oct 8 03:24:50 2007
@@ -3955,7 +3955,7 @@
{
/* only return the interfaces that are up so check the IFF_UP flag) */
returnedInfoHeader = NLMSG_DATA (currentNlHeader);
- if (returnedInfoHeader->ifi_flags & IFF_UP == IFF_UP)
+ if ((returnedInfoHeader->ifi_flags & IFF_UP) == IFF_UP)
{
numAdapters++;
}
@@ -4031,7 +4031,7 @@
returnedInfoHeader = NLMSG_DATA (currentNlHeader);
/* only return adapters that are up */
- if (returnedInfoHeader->ifi_flags & IFF_UP == IFF_UP)
+ if ((returnedInfoHeader->ifi_flags & IFF_UP) == IFF_UP)
{
interfaces[currentAdapterIndex].index =
returnedInfoHeader->ifi_index;
@@ -4375,7 +4375,7 @@
/* make sure the interface is up */
reqCopy = *currentIfReq;
ioctl (SOCKET_CAST (socketP), SIOCGIFFLAGS, &reqCopy);
- if (reqCopy.ifr_flags & IFF_UP == IFF_UP)
+ if ((reqCopy.ifr_flags & IFF_UP) == IFF_UP)
{
numAdapters++;
}
@@ -4416,7 +4416,7 @@
/* make sure the interface is still up */
reqCopy = *currentIfReq;
ioctl (SOCKET_CAST (socketP), SIOCGIFFLAGS, &reqCopy);
- if (reqCopy.ifr_flags & IFF_UP == IFF_UP)
+ if ((reqCopy.ifr_flags & IFF_UP) == IFF_UP)
{
/* since this function can return multiple entries for the same name, only do it for the first one with any given name */
if ((NULL == lastName)
@@ -4636,7 +4636,7 @@
/* make sure the interface is up */
reqCopy = ifc.ifc_req[counter];
ioctl (SOCKET_CAST (socketP), SIOCGIFFLAGS, &reqCopy);
- if (reqCopy.ifr_flags & IFF_UP == IFF_UP)
+ if ((reqCopy.ifr_flags & IFF_UP) == IFF_UP)
{
numAdapters++;
}
@@ -4672,7 +4672,7 @@
/* make sure the interface is still up */
reqCopy = ifc.ifc_req[counter];
ioctl (SOCKET_CAST (socketP), SIOCGIFFLAGS, &reqCopy);
- if (reqCopy.ifr_flags & IFF_UP == IFF_UP)
+ if ((reqCopy.ifr_flags & IFF_UP) == IFF_UP)
{
/* since this function can return multiple entries for the same name, only do it for the first one with any given name */
if ((NULL == lastName)