summaryrefslogtreecommitdiff
path: root/eth-multiplexer
diff options
context:
space:
mode:
Diffstat (limited to 'eth-multiplexer')
-rw-r--r--eth-multiplexer/demuxer.c37
-rw-r--r--eth-multiplexer/ethernet.c7
2 files changed, 26 insertions, 18 deletions
diff --git a/eth-multiplexer/demuxer.c b/eth-multiplexer/demuxer.c
index 1f671b20..68bf9681 100644
--- a/eth-multiplexer/demuxer.c
+++ b/eth-multiplexer/demuxer.c
@@ -1,5 +1,5 @@
/*
- Copyright (C) 1996 Free Software Foundation, Inc.
+ Copyright (C) 1996, 2013 Free Software Foundation, Inc.
Written by Michael I. Bushnell, p/BSG.
This file is part of the GNU Hurd.
@@ -20,22 +20,31 @@
#include <hurd/netfs.h>
+#include "libnetfs/io_S.h"
+#include "libnetfs/fs_S.h"
+#include "libports/notify_S.h"
+#include "libnetfs/fsys_S.h"
+#include "libports/interrupt_S.h"
+#include "libnetfs/ifsock_S.h"
+#include "device_S.h"
+
int
netfs_demuxer (mach_msg_header_t *inp,
mach_msg_header_t *outp)
{
- int netfs_fs_server (mach_msg_header_t *, mach_msg_header_t *);
- int netfs_io_server (mach_msg_header_t *, mach_msg_header_t *);
- int netfs_fsys_server (mach_msg_header_t *, mach_msg_header_t *);
- int netfs_ifsock_server (mach_msg_header_t *, mach_msg_header_t *);
- int device_server (mach_msg_header_t *, mach_msg_header_t *);
-
- return (netfs_io_server (inp, outp)
- || netfs_fs_server (inp, outp)
- || ports_notify_server (inp, outp)
- || netfs_fsys_server (inp, outp)
- || ports_interrupt_server (inp, outp)
- || netfs_ifsock_server (inp, outp)
- || device_server (inp, outp));
+ mig_routine_t routine;
+ if ((routine = netfs_io_server_routine (inp)) ||
+ (routine = netfs_fs_server_routine (inp)) ||
+ (routine = ports_notify_server_routine (inp)) ||
+ (routine = netfs_fsys_server_routine (inp)) ||
+ (routine = ports_interrupt_server_routine (inp)) ||
+ (routine = netfs_ifsock_server_routine (inp)) ||
+ (routine = device_server_routine (inp)))
+ {
+ (*routine) (inp, outp);
+ return TRUE;
+ }
+ else
+ return FALSE;
}
diff --git a/eth-multiplexer/ethernet.c b/eth-multiplexer/ethernet.c
index 32c5589f..886f5df1 100644
--- a/eth-multiplexer/ethernet.c
+++ b/eth-multiplexer/ethernet.c
@@ -76,12 +76,12 @@ int set_promisc (char *dev_name, mach_port_t ether_port, int is_promisc)
#ifndef NET_FLAGS
#define NET_FLAGS (('n'<<16) + 4)
#endif
- short flags;
+ int flags;
int ret;
size_t count;
debug ("set_promisc is called, is_promisc: %d\n", is_promisc);
- count = sizeof (flags);
+ count = 1;
ret = device_get_status (ether_port, NET_FLAGS, (dev_status_t) &flags,
&count);
if (ret)
@@ -93,8 +93,7 @@ int set_promisc (char *dev_name, mach_port_t ether_port, int is_promisc)
flags |= IFF_PROMISC;
else
flags &= ~IFF_PROMISC;
- ret = device_set_status(ether_port, NET_FLAGS, (dev_status_t) &flags,
- sizeof (flags));
+ ret = device_set_status(ether_port, NET_FLAGS, (dev_status_t) &flags, 1);
if (ret)
{
error (0, ret, "device_set_status");