bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] eth-multiplxer: Implement ds_device_close()


From: Joan Lledó
Subject: [PATCH] eth-multiplxer: Implement ds_device_close()
Date: Wed, 20 Sep 2017 12:08:42 +0200

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.

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, when 
lwip tries to create the same interface again, eth-multiplexer returns the same 
port name, and trying to use it leads to a MIG_SERVER_DIED error. This use to 
happen when ifupdown uses dhclient to get an address and is not a problem in 
pfinet since it doesn't remove the interface.

I wrote a little patch to implement ds_device_close(). This patch is working 
for me, but I'm not sure whether it's the right way to do it or may affect 
other servers. I'd appreciate some feedback.

Regards,

Joan



reply via email to

[Prev in Thread] Current Thread [Next in Thread]