Module Name: src
Committed By: njoly
Date: Thu Dec 10 14:58:28 UTC 2009
Modified Files:
src/sys/compat/netbsd32: netbsd32_ioctl.c
Log Message:
Make netbsd32_from_{ifreq,oifreq}() copy the whole structure, not only
the interface name. Finally fix my own PR/39424.
ok by christos.
To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/sys/compat/netbsd32/netbsd32_ioctl.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/compat/netbsd32/netbsd32_ioctl.c
diff -u src/sys/compat/netbsd32/netbsd32_ioctl.c:1.43 src/sys/compat/netbsd32/netbsd32_ioctl.c:1.44
--- src/sys/compat/netbsd32/netbsd32_ioctl.c:1.43 Wed Dec 9 04:50:47 2009
+++ src/sys/compat/netbsd32/netbsd32_ioctl.c Thu Dec 10 14:58:28 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: netbsd32_ioctl.c,v 1.43 2009/12/09 04:50:47 christos Exp $ */
+/* $NetBSD: netbsd32_ioctl.c,v 1.44 2009/12/10 14:58:28 njoly Exp $ */
/*
* Copyright (c) 1998, 2001 Matthew R. Green
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_ioctl.c,v 1.43 2009/12/09 04:50:47 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_ioctl.c,v 1.44 2009/12/10 14:58:28 njoly Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -254,8 +254,7 @@
* union member needs to be converted to 64 bits... this
* is very driver specific and so we ignore it for now..
*/
- (void)memcpy(s32p->ifr_name, p->ifr_name,
- MIN(sizeof(s32p->ifr_name), sizeof(p->ifr_name)));
+ memcpy(s32p, p, sizeof *p);
if (cmd == SIOCGIFDATA || cmd == SIOCZIFDATA)
NETBSD32PTR32(s32p->ifr_data, p->ifr_data);
}
@@ -270,8 +269,7 @@
* union member needs to be converted to 64 bits... this
* is very driver specific and so we ignore it for now..
*/
- (void)memcpy(s32p->ifr_name, p->ifr_name,
- MIN(sizeof(s32p->ifr_name), sizeof(p->ifr_name)));
+ memcpy(s32p, p, sizeof *p);
if (cmd == SIOCGIFDATA || cmd == SIOCZIFDATA)
NETBSD32PTR32(s32p->ifr_data, p->ifr_data);
}