Port-amd64 archive

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

Re: Need advise about linux32 on amd64



On Fri, Jun 20, 2008 at 07:11:23PM +0200, Nicolas Joly wrote:
> 
> Yes. I had a quick look, and SIOCGIFCONF ioctl is currently broken on
> amd64 for both compat linux and linux32 ...
[...]
> As for linux32, the problem is burried in compat netbsd32 where
> *SIOCGIFCONF ioctls handling looks wrong. It does not follow the
> native definitions ... And is missing OOSIOCGIFCONF currently needed
> by linux compat.

Can you try the attached, which should fix SIOCGIFCONF ioctl under
compat linux32 (other ioctls may needs to be adjusted too) ?

-- 
Nicolas Joly

Biological Software and Databanks.
Institut Pasteur, Paris.
Index: sys/compat/linux32/common/linux32_socket.c
===================================================================
RCS file: /cvsroot/src/sys/compat/linux32/common/linux32_socket.c,v
retrieving revision 1.6
diff -u -p -r1.6 linux32_socket.c
--- sys/compat/linux32/common/linux32_socket.c  19 Jun 2008 16:09:25 -0000      
1.6
+++ sys/compat/linux32/common/linux32_socket.c  21 Jun 2008 13:25:31 -0000
@@ -53,10 +53,15 @@ __KERNEL_RCSID(0, "$NetBSD: linux32_sock
 #include <machine/types.h>
 
 #include <net/if.h>
+#include <net/route.h>
+
+#include <netinet/in.h>
+#include <netinet/ip_mroute.h>
 
 #include <sys/syscallargs.h>
 
 #include <compat/netbsd32/netbsd32.h>
+#include <compat/netbsd32/netbsd32_ioctl.h>
 #include <compat/netbsd32/netbsd32_conv.h>
 #include <compat/netbsd32/netbsd32_syscallargs.h>
 #include <compat/sys/sockio.h>
@@ -376,8 +381,8 @@ linux32_ioctl_socket(struct lwp *l, cons
 {
        /* {
                syscallarg(int) fd;
-               syscallarg(u_long) com;
-               syscallarg(void *) data;
+               syscallarg(netbsd32_u_long) com;
+               syscallarg(netbsd32_voidp) data;
        } */
        u_long com;
        int error = 0, isdev = 0, dosys = 1;
@@ -424,7 +429,7 @@ linux32_ioctl_socket(struct lwp *l, cons
 
        switch (com) {
        case LINUX_SIOCGIFCONF:
-               SCARG(&ia, com) = OOSIOCGIFCONF;
+               SCARG(&ia, com) = OOSIOCGIFCONF32;
                break;
        case LINUX_SIOCGIFFLAGS:
                SCARG(&ia, com) = OSIOCGIFFLAGS;
Index: sys/compat/netbsd32/netbsd32_ioctl.c
===================================================================
RCS file: /cvsroot/src/sys/compat/netbsd32/netbsd32_ioctl.c,v
retrieving revision 1.39
diff -u -p -r1.39 netbsd32_ioctl.c
--- sys/compat/netbsd32/netbsd32_ioctl.c        29 May 2008 14:51:26 -0000      
1.39
+++ sys/compat/netbsd32/netbsd32_ioctl.c        21 Jun 2008 13:25:31 -0000
@@ -490,6 +490,8 @@ printf("netbsd32_ioctl(%d, %x, %x): %s g
                IOCTL_STRUCT_CONV_TO(SIOCPHASE2, ifreq);
 #endif
 
+       case OOSIOCGIFCONF32:
+               IOCTL_STRUCT_CONV_TO(OOSIOCGIFCONF, ifconf);
        case OSIOCGIFCONF32:
                IOCTL_STRUCT_CONV_TO(OSIOCGIFCONF, ifconf);
        case SIOCGIFCONF32:
Index: sys/compat/netbsd32/netbsd32_ioctl.h
===================================================================
RCS file: /cvsroot/src/sys/compat/netbsd32/netbsd32_ioctl.h,v
retrieving revision 1.22
diff -u -p -r1.22 netbsd32_ioctl.h
--- sys/compat/netbsd32/netbsd32_ioctl.h        29 May 2008 14:51:26 -0000      
1.22
+++ sys/compat/netbsd32/netbsd32_ioctl.h        21 Jun 2008 13:25:31 -0000
@@ -220,8 +220,9 @@ struct      netbsd32_ifconf {
 };
 #if 1
 /* from <sys/sockio.h> */
-#define        OSIOCGIFCONF32  _IOWR('i', 20, struct netbsd32_ifconf)  /* get 
ifnet list */
-#define        SIOCGIFCONF32   _IOWR('i', 36, struct netbsd32_ifconf)  /* get 
ifnet list */
+#define        OOSIOCGIFCONF32 _IOWR('i', 20, struct netbsd32_ifconf)  /* get 
ifnet list */
+#define        OSIOCGIFCONF32  _IOWR('i', 36, struct netbsd32_ifconf)  /* get 
ifnet list */
+#define        SIOCGIFCONF32   _IOWR('i', 38, struct netbsd32_ifconf)  /* get 
ifnet list */
 #endif
 
 /* from <net/if.h> */


Home | Main Index | Thread Index | Old Index