[Top][All Lists]

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

Making DHCP renew work in pfinet

From: Christian Dietrich
Subject: Making DHCP renew work in pfinet
Date: Sun, 14 Oct 2007 15:36:06 +0200
User-agent: Mutt/1.5.16 (2007-06-11)

this weekend i took Marco Gerards [1] as it is included in the debian
hurd source package. In order to make the routing for the dhcp renew
work. I do always add an route for and the dhcp ports to the

But now, when the /etc/dhclient-script calls fsysopts it will override
all other device informations, e.g. ipv6 addresses, gateways on other
devices. So i changed the commandline/fsysopts interface of pfinet a
little bit: when we call `fsysopts /servers/socket/2 -i eth0 -a` the address of eth1 isn't deleted anymore, but only the
address of eth0 is changed. All other values will be preserved.

I also made a few changes to the pfinet command line in order make 
pfinet work better with multiple interfaces. Now the -i INTERFACE
selects an interface to configure. After selecting the options like -a,
-g are passed. An example:

fsysopt /servers/socket/2 \
  -i eth0 \
    -a192.168.7.2 \
    -g192.168.7.1 \
    -m255.255.255.0 \
  -i eth1 \
    -a10.0.0.2 \
    -g10.0.0.1 \

The whitespaces beetween -a and the ip are missing because -a, -g, -m,
-p, -A, -G have only optional arguments. If the argument is no passed
the value will be unset e.g. the gateway. Because of this we have also
to modify the /etc/dhclient-script.

--- dhclient-script.dpkg-new    2007-06-13 03:57:40.010000000 +0200
+++ dhclient-script     2007-10-14 14:24:54.470000000 +0200
@@ -99,7 +99,6 @@ if [ x$reason = xMEDIUM ]; then
 if [ x$reason = xPREINIT ]; then
-  settrans -afg /servers/socket/2 /hurd/pfinet --dhcp -i $interface
   exit_with_hooks 0
@@ -130,7 +129,7 @@ if [ x$reason = xBOUND ] || [ x$reason =
     #route add -net $new_network_number $new_subnet_arg dev $interface
     for router in $new_routers; do
-      fsysopts /servers/socket/2 -i $interface -a $new_ip_address -m 
$new_subnet_mask -g $router
+      fsysopts /servers/socket/2 -i $interface -a$new_ip_address 
-m$new_subnet_mask -g$router
   if [ x$new_ip_address != x$alias_ip_address ] && [ x$alias_ip_address != x ];

To demonstrate this behaviour a little bit i wrote an very simple
ifconfig like configuration tool to set the .e.g. the ip.


[1] metgerards@student.han.nl

Attachment: ifconfig
Description: Text document

Attachment: pfinet_dhcp.patch
Description: Text Data

reply via email to

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