On Feb 25, 2012, at 6:49 PM, Bruce Dubbs wrote:

> Qrux wrote:
>> On Feb 25, 2012, at 9:14 AM, Bruce Dubbs wrote:
> 
>> Still, it seems awfully specious to say: "It's only the number of
>> files that needs to coincide; everything else is gravy."  The files
>> are indeed supposed to be match the interfaces; that's why there are
>> exactly as many as are interfaces that you want to start. 
> 
> Not true:
> 
> ifconfig.eth0
> ifconfig.eth0:2
> 
> Both use IFACE=eth0.

I think that helps to make the point--that the name ought to reflect what it's 
starting.  Plus, you can still infer eth0 from both filenames.

> Also, the user has the option of ONBOOT=no so there is the capability to 
> manually do ifdown x && ifup y using the same IFACE.

That doesn't change that the name should still reflect what you're going to 
manually start.  The file is still examined, though, to look for ONBOOT.  Point 
is, their presence reflects things about the topology.  Not using names to mean 
what they...mean...is, ATM, just bad practice.  It could be--and probably 
should be--enforced.  That's the precedent in /dev, and despite the fact that 
the network devices don't show up there, we probably want /dev/sda1 to mean 
"sda1".  Make other udevv symlinks if you want the network equivalent of 
/dev/disk/by-id, and you want to screw around with ifconfig.X names.  I mean, 
you could mknod /dev/sda1 to be /dev/null, and /dev/null to be sda1...But why 
would you?  That's probably allowed, but would be pretty surprising to anyone 
using that system.

> I do like using BRIDGE.

Me, too.  I'm working on a slightly modified version now that takes some of 
these other things into consideration.  BRIDGE will probably become BRIDGE_IF.

> +   test -n "${MTU}" -a $MTU -eq $MTU -a 0 -lt $MTU 2> /dev/null
>                         ^^^^^^^^^^^^^
> 
> What does the 2nd segment do?  If you are testing for MTU being an 
> integer, the 3rd segment will do that.

Yep, I was being redundant there.  Sort of stream of consciousness, saying to 
myself: "Oh--it should be a number," and then: "Oh--it should be positive".

> Perhaps it would be better to 
> issue an error statement if the argument is not formatted correctly:
> 
> if test -n "${MTU}"; then
>   if [[ ${MTU} =~ ^[0-9]+$ ]] -a [[ $MTU -ge 68 ]] ; then
>     ip link set dev ${IFACE} mtu $MTU
>   else
>     echo "Invalid MTU $MTU"
>   fi
> fi

Yeah, that looks good.  Is 68 some absolute kernel minimum?  Does that consider 
stuff like SLIP, PPP, ATM, FDDI, IP-over-IEEE-1394, etc?

> Another issue is how to handle the case when the user wants to add eth0 
> and eth1 to the bridge?  I don't think we do that properly in ifup 
> although bridge tries to handle it.

Probably something like:

        BRIDGE_PORTS="eth0 eth1"

in the vein of trying to be explicit in the ifconfig.X file.  I'm working on a 
new version which is already working on some of this stuff.  The ifconfig file 
becomes a bit longer, but it's probably more correct and more robust.

        Q



-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page

Reply via email to