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 so if it isn;t working, isn;t that indicative of a worse problem? or that we have not documented how "dhcp" works sufficiently? 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? 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