[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] eth-multiplxer: Implement ds_device_close()
From: |
Justus Winter |
Subject: |
Re: [PATCH] eth-multiplxer: Implement ds_device_close() |
Date: |
Thu, 21 Sep 2017 12:07:45 +0200 |
Hi :)
"Joan Lledó" <joanlluislledo@gmail.com> writes:
> Hello,
>
> One difference between pfinet and lwip translators is that pfinet doesn't
> delete interfaces (or I haven't found how to do it) while lwip does. For
> instance, if one starts pfinet with:
>
> settrans -fga /servers/socket/2 /hurd/pfinet -i /dev/eth1 -a 192.168.123.178
> -m 255.255.255.0 -g 192.168.123.1
>
> and then runs:
>
> fsysopts /servers/socket/2 --interface=/dev/eth2 --address=192.168.124.178
> --netmask=255.255.255.0 --gateway=192.168.124.1
>
> the result is this:
>
> root@hurd:/home/jlledom# fsysopts /servers/socket/2
> /hurd/pfinet --interface=/dev/eth1 --address=192.168.123.178
> --netmask=255.255.255.0 --address6=fc00:123::5054:ff:feb6:1ab3/64
> --address6=fe80::5254:b6:1ab3/10 --address6=fe80::5054:ff:feb6:1ab3/10
> --gateway6=fe80::5054:ff:fef6:d496 --interface=/dev/eth2
> --address=192.168.124.178 --netmask=255.255.255.0 --gateway=192.168.124.1
> --address6=fe80::5254:4b:ad11/10 --address6=fe80::5054:ff:fe4b:ad11/10
>
> fsysopts added a new interface. But doing the same with lwip leads to this:
>
> root@hurd:/home/jlledom# fsysopts /servers/socket/2
> /hurd/lwip --interface=/dev/eth2 --address=192.168.124.178
> --netmask=255.255.255.0 --gateway=192.168.124.1
> --address6=FE80::5054:FF:FE4B:AD11/64
> --address6=FC00:124::5054:FF:FE4B:AD11/64
>
> The stack is reset and reconfigured, and only the given interface is added. I
> implemented this by simply removing all interfaces anytime somebody calls
> fsysopts, and adding the new ones. If some interface already exists, it's
> deleted and created again.
Afaik using multiple interfaces is not something that many people have
done, so either behavior looks okay to me.
> This behaviour generated a problem when working with
> eth-multiplexer. Adding a new interface calls ds_device_open in
> eth-multiplexer and that returns a port name, whereas deleting the
> interface deallocates the port name in lwip, but nothing happens in
> eth-multiplexer since ds_device_close is unimplemented,
ds_device_close is not unimplemented, it merely does nothing. But
indeed, nothing happens when the only sender deallocates its port
because of the way eth-multiplexer handles the device objects (it puts
them into a linked list with a hard reference, preventing the proper
deallocation of the port). I'll try to fix that.
> when lwip
> tries to create the same interface again, eth-multiplexer returns the
> same port name,
That should be fine though.
> and trying to use it leads to a MIG_SERVER_DIED
> error.
Please confirm that eth-multiplexer does not die.
MIG_SERVER_DIED is generated by the mig-generated client stubs when the
replies message id does not matche the expected id, but
MACH_NOTIFY_SEND_ONCE. This message is generated by the kernel if a
send-once right is destroyed. This usually happens when the server
dies, but could in theory happen when the server explicitly destroys the
reply port, but tbh I couldn't see why or where that should happen.
Cheers,
Justus