axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sa...@apache.org
Subject svn commit: r554528 - in /webservices/axis2/trunk/c/util: include/platforms/unix/axutil_uuid_gen_unix.h src/platforms/unix/uuid_gen_unix.c
Date Mon, 09 Jul 2007 06:02:02 GMT
Author: sahan
Date: Sun Jul  8 23:02:02 2007
New Revision: 554528

URL: http://svn.apache.org/viewvc?view=rev&rev=554528
Log:
Fixing a problem of generating NULL mac addresses for the machines without "up" interfaces
on Linux. Currently we assign a default mac address if no interfaces are up

Modified:
    webservices/axis2/trunk/c/util/include/platforms/unix/axutil_uuid_gen_unix.h
    webservices/axis2/trunk/c/util/src/platforms/unix/uuid_gen_unix.c

Modified: webservices/axis2/trunk/c/util/include/platforms/unix/axutil_uuid_gen_unix.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/util/include/platforms/unix/axutil_uuid_gen_unix.h?view=diff&rev=554528&r1=554527&r2=554528
==============================================================================
--- webservices/axis2/trunk/c/util/include/platforms/unix/axutil_uuid_gen_unix.h (original)
+++ webservices/axis2/trunk/c/util/include/platforms/unix/axutil_uuid_gen_unix.h Sun Jul 
8 23:02:02 2007
@@ -23,6 +23,7 @@
 
 #define UUIDS_PER_TICK 100
 #define UUID_TIMEOFFSET AXIS2_UNSIGNED_LONGLONGVALUE(0x01B21DD213814000)
+#define AXIS2_LOCAL_MAC_ADDR "000000"
 
 #ifdef __cplusplus
 extern "C"

Modified: webservices/axis2/trunk/c/util/src/platforms/unix/uuid_gen_unix.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/util/src/platforms/unix/uuid_gen_unix.c?view=diff&rev=554528&r1=554527&r2=554528
==============================================================================
--- webservices/axis2/trunk/c/util/src/platforms/unix/uuid_gen_unix.c (original)
+++ webservices/axis2/trunk/c/util/src/platforms/unix/uuid_gen_unix.c Sun Jul  8 23:02:02
2007
@@ -221,26 +221,22 @@
     char buf[1024];
     int ok = AXIS2_FALSE;
 
-
     if ((s = socket(PF_INET, SOCK_DGRAM, 0)) < 0)
         return NULL;
 
     ifc.ifc_len = sizeof(buf);
     ifc.ifc_buf = buf;
     ioctl(s, SIOCGIFCONF, &ifc);
-
     IFR = ifc.ifc_req;
 
     for(i = ifc.ifc_len/sizeof(struct ifreq); --i >=0; IFR++)
     {
         strcpy(ifr.ifr_name, IFR->ifr_name);
-    
         /*sprintf(ifr.ifr_name, "eth0");*/
         if (ioctl(s, SIOCGIFFLAGS, &ifr) == 0)
         {
             if(!(ifr.ifr_flags & IFF_LOOPBACK))
             {
-                
                 if (ioctl(s, SIOCGIFHWADDR, &ifr) == 0)
                 {
                     ok = AXIS2_TRUE;
@@ -249,12 +245,17 @@
             }
         }
     }
+    buffer = (char*)malloc(6 * sizeof(char));
     if(ok)
     {
-        buffer = (char*)malloc(6 * sizeof(char));
         sa = (struct sockaddr *) & ifr.ifr_addr;
         for (i = 0; i < 6; i++)
             buffer[i] = (unsigned char)(sa->sa_data[i] & 0xff);
+    }
+    else
+    {
+        for (i = 0; i < 6; i++)
+            buffer[i] = (unsigned char)(AXIS2_LOCAL_MAC_ADDR[i]);
     }
     close(s);
     return buffer;



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org


Mime
View raw message