On Tue, Jan 31, 2012 at 01:21:40PM -0800, Gurucharan Shetty wrote:
> The current network-script, ifup-ovs  does not work well if you
> enable DHCP on the OVS. It will work if we name the bridge
> alphabetically greater than the underlying physical interfaces.
> Even then, it will do multiple DHCP attempts slowing down the boot
> up process.
> 
> This patch allows DHCP on an OVS bridge.
> 
> Signed-off-by: Gurucharan Shetty <gshe...@nicira.com>

I'm so sorry to keep picking at this patch.  I don't like to do that.
My apologies.  But, regardless, I just noticed that
    if [ "${OVSBOOTPROTO}" = "dhcp" -a -n "${OVSINTF}" ]; then
should really be written as
    if [ "${OVSBOOTPROTO}" = "dhcp" ] && [ -n "${OVSINTF}" ]; then
for safety.  As POSIX says:

    Scripts should be careful when dealing with user-supplied input
    that could be confused with primaries and operators. Unless the
    application writer knows all the cases that produce input to the
    script, invocations like:

    test "$1" -a "$2"

    should be written as:

    test "$1" && test "$2"

    to avoid problems if a user supplied values such as $1 set to '!'
    and $2 set to the null string. That is, in cases where maximal
    portability is of concern, replace:

    test expr1 -a expr2

    with:

    test expr1 && test expr2

    and replace:

    test expr1 -o expr2

    with:

    test expr1 || test expr2

    but note that, in test, -a has higher precedence than -o while
    "&&" and "||" have equal precedence in the shell.

Similarly, replace:
    if [ "${OVSBOOTPROTO}" != "dhcp" -a -z "${OVSINTF}" ]; then
by:
    if [ "${OVSBOOTPROTO}" != "dhcp" ] && [ -z "${OVSINTF}" ]; then

And then I think we're done!
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to