diff options
author | Sergey Bugaev <bugaevc@gmail.com> | 2021-08-05 17:57:45 +0300 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2022-08-10 22:12:43 +0200 |
commit | 99df125e1048d9d09cfb68ce54725a089bacc140 (patch) | |
tree | 8e80e3105a99df200fc54d33629ddfb533bd6482 /eth-multiplexer | |
parent | a239719cd41e2c409366570f84639fa4a322c88b (diff) | |
download | hurd-99df125e1048d9d09cfb68ce54725a089bacc140.tar.gz hurd-99df125e1048d9d09cfb68ce54725a089bacc140.tar.bz2 hurd-99df125e1048d9d09cfb68ce54725a089bacc140.zip |
eth-multiplexer: Use ports_request_dead_name_notification ()
Diffstat (limited to 'eth-multiplexer')
-rw-r--r-- | eth-multiplexer/device_impl.c | 13 | ||||
-rw-r--r-- | eth-multiplexer/multiplexer.c | 7 |
2 files changed, 4 insertions, 16 deletions
diff --git a/eth-multiplexer/device_impl.c b/eth-multiplexer/device_impl.c index 74f78f22..c4d393ac 100644 --- a/eth-multiplexer/device_impl.c +++ b/eth-multiplexer/device_impl.c @@ -33,8 +33,6 @@ #include "netfs_impl.h" #include "util.h" -extern struct port_info *notify_pi; - /* Implementation of device interface */ /* @@ -183,18 +181,15 @@ kern_return_t ds_device_set_filter (struct vether_device *vdev, mach_port_t receive_port, int priority, filter_array_t filter, size_t filterlen) { - mach_port_t tmp; kern_return_t err; + if (vdev == NULL) return D_NO_SUCH_DEVICE; - err = mach_port_request_notification (mach_task_self (), receive_port, - MACH_NOTIFY_DEAD_NAME, 0, - notify_pi->port_right, - MACH_MSG_TYPE_MAKE_SEND_ONCE, &tmp); + + err = ports_request_dead_name_notification (vdev, receive_port, NULL); if (err != KERN_SUCCESS) goto out; - if (tmp != MACH_PORT_NULL) - mach_port_deallocate (mach_task_self (), tmp); + err = net_set_filter (&vdev->port_list, receive_port, priority, filter, filterlen); out: diff --git a/eth-multiplexer/multiplexer.c b/eth-multiplexer/multiplexer.c index a08b9f71..4cd77a1e 100644 --- a/eth-multiplexer/multiplexer.c +++ b/eth-multiplexer/multiplexer.c @@ -66,7 +66,6 @@ static const struct argp_option options[] = struct port_bucket *port_bucket; struct port_class *other_portclass; struct port_class *vdev_portclass; -struct port_info *notify_pi; int netfs_maxsymlinks = 12; char *netfs_server_name = "multiplexer"; @@ -146,12 +145,6 @@ main (int argc, char *argv[]) other_portclass); } - /* Prepare for the notification. */ - err = ports_create_port (other_portclass, port_bucket, - sizeof (struct port_info), ¬ify_pi); - if (err) - error (1, err, "ports_create_port for notification"); - task_get_bootstrap_port (mach_task_self (), &bootstrap); if (bootstrap == MACH_PORT_NULL) error (1, 0, "must be started as a translator"); |