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.

> 
> 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.

> 
> 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.

> 
> 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

Reply via email to