Penned by Kenneth R. Westerback on 20121126 12:58.45, we have:
| On Mon, Nov 26, 2012 at 05:40:06PM +0000, Jason McIntyre wrote:
| > On Mon, Nov 26, 2012 at 07:19:23PM +0200, Paul Irofti wrote:
| > > On Mon, Nov 26, 2012 at 04:26:12PM +0000, Jason McIntyre wrote:
| > > > On Mon, Nov 26, 2012 at 04:30:47PM +0200, Paul Irofti wrote:
| > > > > Be more specific about the order of interpretation. Okay?
| > > > >
| > > > > diff --git share/man/man5/hostname.if.5 share/man/man5/hostname.if.5
| > > > > index b07459f..aa8446f 100644
| > > > > --- share/man/man5/hostname.if.5
| > > > > +++ share/man/man5/hostname.if.5
| > > > > @@ -49,6 +49,8 @@ A configuration file is not needed for lo0.
| > > > > The configuration information is expressed in a line-by-line packed
format
| > > > > which makes the most common cases simpler; those dense formats are
described
| > > > > below.
| > > > > +The order of the configuration lines matters, they are interpreted
from the
| > > > > +top down.
| > > > > Any lines not matching these packed formats are passed directly to
| > > > > .Xr ifconfig 8 .
| > > > > The packed formats are converted using a somewhat inflexible parser
and
| > > > >
| > > >
| > > > if we say this, then we should provide guidance to folks about how to
| > > > order the lines. what is the specific problem, or the general rule, that
| > > > you are addressing?
| > >
| > > Problem:
| > >
| > > /etc/hostname.iwn0:
| > > dhcp
| > > nwid foo
| > > wpakey bar
| > >
| > > Gets neighbour's lease then drops it then gets the lease from the foo
| > > network using the bar wpakey.
| > >
| > > Solution:
| > >
| > > /etc/hostname.iwn0
| > > nwid foo
| > > wpakey bar
| > > dhcp
| > >
| > > Sets the network to foo and associates a password to it and then tries
| > > to get a lease.
| > >
| > > Order matters. Perhaps there's a better way to phrase it but, as far as
| > > guidance goes, I guess it's not quite possible to do that because
| > > ifconfig alone has a plethora of possible usages.
| > >
| >
| > does "dhcp nwid foo wpakey bar" give you problems too? because
| > hostname.if(5) suggests it should not:
| >
| > A DHCP-configured network interface setup consists of
| >
| > dhcp options
|
| There have been problems reported with doing everything on one line in the
| past.
In this scenario 'options' may as well be called 'ifconfig-options'.
| >
| > so if it isn;t working, isn;t that indicative of a worse problem? or
| > that we have not documented how "dhcp" works sufficiently?
|
| Not sure how much more we can document here. I'm actually wondering if it
| wouldn't be more clear to eliminate the 'options' processing after 'dhcp',
| i.e. make people do those things on separate, preceeding lines.
Welcome to the pain that is 'do we break backwards compat?'
There is a lot we could do if we could break backwards compat.
| > we can;t just say order matters, but not provide any guidance. having
| > said that, i think the text "The packed formats are converted", which i
| > think deraadt added, was meant to address something like this. maybe he
| > remembers?
|
| Well, hostname.if is simply a mechanism to script ifconfig invocations. If
| you don't know in what order you need to issue the ifconfig invocations
| required to configure your network, I'm not sure if hostname.if can
| explain it in a reasonable amount of space.
Indeed. The 'shorthand' or 'packed' syntax of hostname.if permits avoiding
typing 'netmask' in the v4 case and 'prefixlen' in the v6 case, for example.
| > anyway...i still dislike the idea of just saying order matters. also,
| > could someone really expect the file to not be parsed top down (i don;t
| > know, i'm just asking. it seems unlikely to me you'd start parsing from
| > the end and work up)?
| >
| > jmc
| >
|
| The misunderstanding I have seen run along the lines that all the
| lines will be processed and then the system will issue a coherent set of
| commands to achieve the described network. When really it is, as I said,
| just a way to put all the ifconfig and related commands in one file.
|
| ..... Ken
There is limited intelligence in the hostname.if parser implemented in
sh. It passes things to ifconfig rather blindly and definitely does
things in order without regards to any intelligence.
If one were to have a hostname.if consisting of:
up
down
up
down
up
down
up
down
You'd need to understand that 'up' is passed to one invocation of
ifconfig, down to another, and so on, in order.
Generally speaking, one line in hostname.if (that is not a comment)
is one action. The exception is the line beginning with 'dest' which
was invented to permit gif(4) tunnel configuration syntax.
If there are desires to improve this (I hear Naddy grumbling!) then the
stomach to break backwards compat must be present, or suggestions on how
to do it without breaking backwards compat must be suggested. I'm out
of ideas, but will be glad to work with anyone towards any changes
desired so long as it is clear what the grammar of hostname.if should
look like as well as the resulting behavior.
Thanks,
--
Todd Fries .. [email protected]
____________________________________________
| \ 1.636.410.0632 (voice)
| Free Daemon Consulting, LLC \ 1.405.227.9094 (voice)
| http://FreeDaemonConsulting.com \ 1.866.792.3418 (FAX)
| PO Box 16169, Oklahoma City, OK 73113 \ sip:[email protected]
| "..in support of free software solutions." \ sip:[email protected]
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
37E7 D3EB 74D0 8D66 A68D B866 0326 204E 3F42 004A
http://todd.fries.net/pgp.txt