bug-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[RFC]: gdomap on 64-bit machine


From: Adam Fedor
Subject: [RFC]: gdomap on 64-bit machine
Date: Fri, 15 Apr 2005 15:51:04 -0600

This patch fixes gdomap on sparc64 machines (NetBSD). I assume it would still work on other machines, but I haven't really been able to test it elsewhere yet.

The problem is that gdomap still does not work here. Here's the syslog output, showing that even when I run gdnc, gdomap does not think it is registered. I'm still working on that part, but if anyone has ideas, let me know (Note: I've compiled gdomap with the non-root hack since I don't have admin access to the machine. Is that affecting anything?):

 Apr 15 21:13:33 atlantis gdomap: SIOCGIFFLAGS: m
 Apr 15 21:13:33 atlantis last message repeated 11 times
Apr 15 21:13:33 atlantis gdomap: I can't find the loopback interface on this machine. Apr 15 21:13:33 atlantis gdomap: Perhaps you should correct your machine configuration or use the -a flag. Apr 15 21:13:33 atlantis gdomap: I am assuming loopback interface on 127.0.0.1

bash-3.00$ ps auwx | grep gd
fedor 25581 2.8 2.0 3520 6632 p0 S 9:13PM 0:00.20 /Net/alice/Users/fedor/gnustep-atlantis/System/Tools/gdnc --daemon
fedor 26419  1.0  0.3  208  1000 p0  S+    9:13PM 0:00.02 grep gd
root 147 0.0 0.3 256 944 ?? Ss 12:21PM 0:00.10 /usr/sbin/syslogd -s fedor 25703 0.0 0.4 216 1304 ?? Ss 9:13PM 0:00.01 ./shared_obj/gdomap
bash-3.00$ ./shared_obj/gdomap -N
No names currently registered with gdomap


Index: gdomap.c
===================================================================
RCS file: /cvsroot/gnustep/gnustep/core/base/Tools/gdomap.c,v
retrieving revision 1.94
diff -u -r1.94 gdomap.c
--- gdomap.c    21 Feb 2005 14:44:18 -0000      1.94
+++ gdomap.c    15 Apr 2005 19:29:39 -0000
@@ -128,6 +128,10 @@

 #define        MAX_EXTRA       ((GDO_NAME_MAX_LEN - 2 * IASIZE)/IASIZE)

+#define ROUND(V, A) \
+  ({ typeof(V) __v=(V); typeof(A) __a=(A); \
+        __a*((__v+__a-1)/__a); })
+
 typedef        unsigned char   *uptr;
 #ifndef __MINGW__
 static int     is_daemon = 0;          /* Currently running as daemon.  */
@@ -1264,8 +1268,10 @@
   for (ifr_ptr = ifc.ifc_req; ifr_ptr < final;)
     {
       ifreq = *(struct ifreq*)ifr_ptr;
+
 #ifdef HAVE_SA_LEN
- ifr_ptr += sizeof(ifreq) - sizeof(ifreq.ifr_addr) + ifreq.ifr_addr.sa_len;
+      ifr_ptr += sizeof(ifreq) - sizeof(ifreq.ifr_addr)
+       + ROUND(ifreq.ifr_addr.sa_len, sizeof(struct ifreq*));
 #else
       ifr_ptr += sizeof(ifreq);
 #endif







reply via email to

[Prev in Thread] Current Thread [Next in Thread]