On 2011/08/16 16:24, Stefan Sperling wrote:
> > Either way (your patch or with a wrapper script) if a new IP address
> > is assigned you might have some problems with delete_old_routes
> > flushing all routes including the route over the tunnel; not sure
> > how important this is in practice in your case,
> 
> It is not important. The route is restored quickly and no packets
> are misrouted after routes are deleted. My only problem are live
> routes that point the wrong way.

The scenario I was considering is if you have packets actively
sent while the route is missing; I think there are some circumstances
(probably involving pmtu) where you can end up with cloned host routes
which would point to the wrong gateway.

> > (this would also let you fetch an address on an interface via DHCP
> > without changing routes, sometimes it can be rather useful to do
> > this on a machine where changing the default route will cause
> > disruption..)
> 
> Not sure why you would want this. If the new address is on a different
> subnet the old routes are of no use.

I've wanted this when I've been remotely doing an initial
configuration of gear which has its own DHCP server, e.g. adsl
routers. So I might get someone to connect it up to a spare nic
or switch port which I then attach to a vlan interface, then
grab an address via DHCP, and configure it up.

This can of course be done via a script too but would mean a
lot more to write, as it has to replace rather than wrap
the current script.

On 2011/08/16 17:48, Henning Brauer wrote:
> wait. my (and ifaik that is also where krw's wish comes from) desire
> to replace the script comes from the routehandler. dhclient exits when
> something else sets an address on the interface in question. right now
> we have a hack there. if dhclient itself set the address its pid would
> show up in the message on the route socket and we could easily ignore
> those. right now it is the pid of the ifconfig process spawned by the
> script. and dhclient doesn't know that pid.
> so the idea is to have dhclient set the address itself instead of
> having the script do it. just that task. not everything else the
> script does. aka the script stays, just not setting the address any
> more. 

IMO this makes a lot more sense than removing the script.

Reply via email to