summaryrefslogtreecommitdiff
path: root/trans
diff options
context:
space:
mode:
authorJustus Winter <4winter@informatik.uni-hamburg.de>2014-03-01 11:55:50 +0100
committerJustus Winter <4winter@informatik.uni-hamburg.de>2014-03-01 11:55:50 +0100
commit666830d8a75a3676f60b48028b115edb19d06cc7 (patch)
tree299ddc31343cbba6d11a8015d3a2faeaf3406874 /trans
parente3a2c2caeea0a4f4d36b1117610d2a32d14ac69b (diff)
trans/ifsock: fix receiver lookup
* trans/Makefile: Add ifsock-MIGSFLAGS. * trans/ifsock.c (S_ifsock_getsockaddr): Fix receiver lookup.
Diffstat (limited to 'trans')
-rw-r--r--trans/Makefile5
-rw-r--r--trans/ifsock.c9
2 files changed, 9 insertions, 5 deletions
diff --git a/trans/Makefile b/trans/Makefile
index e74a8692..a2942820 100644
--- a/trans/Makefile
+++ b/trans/Makefile
@@ -37,6 +37,11 @@ password-MIGSFLAGS=\
"-DIO_DESTRUCTOR=trivfs_end_using_protid (trivfs_protid_t)" \
"-DPASSWORD_IMPORTS=import \"../libtrivfs/mig-decls.h\";"
+ifsock-MIGSFLAGS=\
+ "-DFILE_INTRAN=trivfs_protid_t trivfs_begin_using_protid (io_t)" \
+ "-DFILE_DESTRUCTOR=trivfs_end_using_protid (trivfs_protid_t)" \
+ "-DIFSOCK_IMPORTS=import \"../libtrivfs/mig-decls.h\";"
+
include ../Makeconf
vpath elfcore.c $(top_srcdir)/exec
diff --git a/trans/ifsock.c b/trans/ifsock.c
index 092bb40d..4ed65898 100644
--- a/trans/ifsock.c
+++ b/trans/ifsock.c
@@ -131,15 +131,15 @@ trivfs_goaway (struct trivfs_control *fsys, int flags)
}
error_t
-S_ifsock_getsockaddr (file_t sockfile,
+S_ifsock_getsockaddr (struct trivfs_protid *cred,
mach_port_t *address)
{
- struct trivfs_protid *cred = ports_lookup_port (port_bucket, sockfile,
- node_class);
int perms;
error_t err;
- if (!cred)
+ if (!cred
+ || cred->pi.bucket != port_bucket
+ || cred->pi.class != node_class)
return EOPNOTSUPP;
err = file_check_access (cred->realnode, &perms);
@@ -148,6 +148,5 @@ S_ifsock_getsockaddr (file_t sockfile,
if (!err)
*address = address_port;
- ports_port_deref (cred);
return err;
}