* [PATCH NFSIM]: use unsigned long for nf_userspace_message args
@ 2005-01-06 14:10 Patrick McHardy
0 siblings, 0 replies; only message in thread
From: Patrick McHardy @ 2005-01-06 14:10 UTC (permalink / raw)
To: Rusty Russell; +Cc: Netfilter Development Mailinglist
[-- Attachment #1: Type: text/plain, Size: 93 bytes --]
nf_userspace_message args may hold pointers, use unsigned long so they
also fit on 64 bit.
[-- Attachment #2: 2.diff --]
[-- Type: text/x-patch, Size: 2631 bytes --]
Index: core/fakesockopt.c
===================================================================
--- core/fakesockopt.c (revision 3578)
+++ core/fakesockopt.c (working copy)
@@ -234,8 +234,8 @@
msg.args[0] = PF_INET;
/*msg.args[1] = level;*/
msg.args[1] = optname;
- msg.args[2] = (int)optval;
- msg.args[3] = (int)*optlen;
+ msg.args[2] = (unsigned long)optval;
+ msg.args[3] = (unsigned long)*optlen;
ret = fake_syscall(&msg);
*optlen = msg.args[3];
return ret;
@@ -249,8 +249,8 @@
msg.args[0] = PF_INET;
/*msg.args[1] = level;*/
msg.args[1] = optname;
- msg.args[2] = (int)optval;
- msg.args[3] = (int)optlen;
+ msg.args[2] = (unsigned long)optval;
+ msg.args[3] = (unsigned long)optlen;
return fake_syscall(&msg);
}
Index: core/nfsockopt.h
===================================================================
--- core/nfsockopt.h (revision 3578)
+++ core/nfsockopt.h (working copy)
@@ -45,7 +45,7 @@
int len;
/* syscall/kernelop arguments */
- int args[MAX_MESSAGE_ARGS];
+ unsigned long args[MAX_MESSAGE_ARGS];
/* return val of the syscall/kernelop */
int retval;
Index: core/message.c
===================================================================
--- core/message.c (revision 3578)
+++ core/message.c (working copy)
@@ -282,7 +282,7 @@
msg.args[3]);
msg.retval = nf_getsockopt(NULL, msg.args[0],
msg.args[1], (char *)msg.args[2],
- &msg.args[3]);
+ (int *)&msg.args[3]);
if (strace)
nfsim_log(LOG_USERSPACE,
" getsockopt -> %s (len %i)",
@@ -358,9 +358,9 @@
msg->type = UM_KERNELOP;
msg->opcode = KOP_COPY_TO_USER;
msg->len = n;
- msg->args[0] = (int)to;
- msg->args[1] = (int)from;
- msg->args[2] = (int)n;
+ msg->args[0] = (unsigned long)to;
+ msg->args[1] = (unsigned long)from;
+ msg->args[2] = (unsigned long)n;
/* Keep valgrind happy.*/
msg->args[3] = 0;
@@ -393,9 +393,9 @@
msg.type = UM_KERNELOP;
msg.opcode = KOP_COPY_FROM_USER;
msg.len = 0;
- msg.args[0] = (int)to;
- msg.args[1] = (int)from;
- msg.args[2] = (int)n;
+ msg.args[0] = (unsigned long)to;
+ msg.args[1] = (unsigned long)from;
+ msg.args[2] = (unsigned long)n;
/* Keep valgrind happy.*/
msg.args[3] = 0;
Index: core/core.c
===================================================================
--- core/core.c (revision 3578)
+++ core/core.c (working copy)
@@ -431,7 +431,7 @@
oldpath = getenv("LD_LIBRARY_PATH");
path = talloc_asprintf(NULL, "%s%s%.*s",
oldpath ?:"", oldpath ? ":" : "",
- p - argv[0], argv[0]);
+ (int)(p - argv[0]), argv[0]);
setenv("LD_LIBRARY_PATH", path, 1);
talloc_free(path);
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2005-01-06 14:10 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-01-06 14:10 [PATCH NFSIM]: use unsigned long for nf_userspace_message args Patrick McHardy
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.