[Netconf-devel] Re: interapplet bugs

Thomas Hood jdthood@aglu.demon.nl
Tue, 19 Apr 2005 09:55:25 +0200


On Tue, 2005-04-19 at 08:38 +0800, Grahame Bowland wrote:
> I guess I want to provide a list of physical interfaces that match any
> mapping statement in /etc/network/interfaces. That would be the correct
> way to do things.


If the correct functioning of interapplet requires the interapplet
mapping script then I suggest you compile the list in the following way.
Start with the list of interfaces named in /proc/net/dev (first field).
These are all the physical interfaces known to the kernel.  Remove "lo"
from the list.  Filter the list by running it through grep or sed with
the same glob patterns as appear in /e/n/i after "mapping" keywords, for
all stanzas in which the interapplet mapping script's name appears after
the "script" keyword.

For each such physical interface X, make a list of which logical
interface definitions in /e/n/i as which X could reasonably be
configured.  This is the list that goes in the submenu for X.

Some logical interface definitions are such that the corresponding
physical interfaces are created when they are configured as those
logical interfaces.  The user runs "ifup foo=bar" and in the process of
running the commands defined for the "bar" logical interface, the
physical interface "foo" gets created.  If you want to handle such cases
then I recommend that you solve it in the same way as netapplet does,
which is as follows.  If a logical interface definition L contains a
"creates" option then add the argument of that option, P, to the list of
physical interfaces and make the name of L the only item in the list of
candidate logical interfaces for P.  Exclude L from the lists of logical
interface candidates for physical interfaces other than P.

I would recommend not supporting the control of PPP interfaces -- at
least, not yet.  Almost no one uses ifupdown to control PPP interfaces,
the reason being that ifupdown's handling of PPP interfaces has never
been correct.  People use pon and poff to control PPP interfaces.  To
control PPP interfaces via the panel people use the Modem Lights Applet
(or whatever GNOME is calling it this week).

Details: Currently, ifup just runs pon and ifdown just runs poff.
However, pon and poff are asynchronous with pppd which they start/stop
and so ifupdown "up" and "down" scripts get run before the PPP interface
has come into existence/gone out of existence.  This is very broken.
Another problem is that ifup takes a physical interface name as an
argument and keeps an internal record that this interface has been
brought up; however, the name of the PPP interface that gets created by
pon may be different from the one given to ifup.  Furthermore, the PPP
interface can disappear at any time and ifup still thinks it is up.  So,
ifup/ifdown are really just inconvenient and malfunctional wrappers for
pon/poff; and that is why no one uses them to control PPP interfaces.  I
should mention that the experimental version of ifupdown support has
fixed PPP support; however, it is unlikely that this version will ever
be released because the ifupdown maintainer only seems to take an
interest in the package once every four years.

-- 
Thomas Hood <jdthood@aglu.demon.nl>