[Ovirt-devel] [PATCH node] validify ipv4/ipv6 static/dhcp choice else loop

Joey Boggs jboggs at redhat.com
Mon Nov 9 17:43:02 UTC 2009


Darryl L. Pierce wrote:
> On Fri, Oct 09, 2009 at 01:51:20PM -0400, Joey Boggs wrote:
>   
>> If you select an option that's not listed during ipv4/ipv6 setup it will accept it without verification. This corrects that behavior and forces a valid option to be picked.
>> ---
>>  scripts/ovirt-config-networking |  106 +++++++++++++++++++++------------------
>>  1 files changed, 58 insertions(+), 48 deletions(-)
>>
>> diff --git a/scripts/ovirt-config-networking b/scripts/ovirt-config-networking
>> index 7d4e363..45f7129 100755
>> --- a/scripts/ovirt-config-networking
>> +++ b/scripts/ovirt-config-networking
>> @@ -160,56 +160,66 @@ function configure_interface
>>                      return;;
>>              esac
>>  
>> -            read -ep "Enable IPv4 support ([S]tatic IP, [D]HCP, [N]o or [A]bort)? "
>> -            case $REPLY in
>> -                D|d)
>> -                    BR_CONFIG="$BR_CONFIG\nset $BR_ROOT/BOOTPROTO dhcp"
>> -                    ;;
>> -                S|s)
>> -                    printf "\n"
>> -                    read -ep "IP Address: "; IPADDR=$REPLY
>> -                    read -ep "   Netmask: "; NETMASK=$REPLY
>> -                    read -ep "   Gateway: "; GATEWAY=$REPLY
>> -
>> -                    BR_CONFIG="$BR_CONFIG\nset $BR_ROOT/BOOTPROTO none"
>> -                    BR_CONFIG="$BR_CONFIG\nset $BR_ROOT/IPADDR $IPADDR"
>> -                    BR_CONFIG="$BR_CONFIG\nset $BR_ROOT/NETMASK $NETMASK"
>> -                    if [ -n "${GATEWAY}" ]; then
>> -                        BR_CONFIG="$BR_CONFIG\nset $BR_ROOT/GATEWAY $GATEWAY"
>> -                    fi
>> -                    ;;
>> -                A|a)
>> -                    CONFIGURED_NIC=""
>> -                    VLAN_ID=""
>> -                    return
>> -                    ;;
>> -            esac
>> +            while true; do
>> +                read -ep "Enable IPv4 support ([S]tatic IP, [D]HCP, [N]o or [A]bort)? "
>> +                case $REPLY in
>> +                    D|d)
>> +                        BR_CONFIG="$BR_CONFIG\nset $BR_ROOT/BOOTPROTO dhcp"
>> +                        break
>> +                        ;;
>> +                    S|s)
>> +                        printf "\n"
>> +                        read -ep "IP Address: "; IPADDR=$REPLY
>> +                        read -ep "   Netmask: "; NETMASK=$REPLY
>> +                        read -ep "   Gateway: "; GATEWAY=$REPLY
>> +
>> +                        BR_CONFIG="$BR_CONFIG\nset $BR_ROOT/BOOTPROTO none"
>> +                        BR_CONFIG="$BR_CONFIG\nset $BR_ROOT/IPADDR $IPADDR"
>> +                        BR_CONFIG="$BR_CONFIG\nset $BR_ROOT/NETMASK $NETMASK"
>> +                        if [ -n "${GATEWAY}" ]; then
>> +                            BR_CONFIG="$BR_CONFIG\nset $BR_ROOT/GATEWAY $GATEWAY"
>> +                        fi
>> +                        break
>> +                        ;;
>> +                    A|a)
>> +                        CONFIGURED_NIC=""
>> +                        VLAN_ID=""
>> +                        return
>> +                        ;;
>> +                esac
>> +            done
>>  
>>              printf "\n"
>> -            read -ep "Enable IPv6 support ([S]tatic, [D]HCPv6, A[u]to, [N]o or [A]bort)? "
>> -            case $REPLY in
>> -                S|s)
>> -                    read -ep "IPv6 Address: "; IPADDR=$REPLY
>> -                    BR_CONFIG="$BR_CONFIG\nset $BR_ROOT/IPV6INIT yes"
>> -                    BR_CONFIG="$BR_CONFIG\nset $BR_ROOT/IP6ADDR $IPADDR"
>> -                    ;;
>> -                D|d)
>> -                    BR_CONFIG="$BR_CONFIG\nset $BR_ROOT/IPV6INIT yes"
>> -                    BR_CONFIG="$BR_CONFIG\nset $BR_ROOT/IPV6AUTCONF no"
>> -                    BR_CONFIG="$BR_CONFIG\nset $BR_ROOT/IPV6FORWARDING no"
>> -                    BR_CONFIG="$BR_CONFIG\nset $BR_ROOT/DHCPV6C yes"
>> -                    ;;
>> -                U|u)
>> -                    BR_CONFIG="$BR_CONFIG\nset $BR_ROOT/IPV6INIT yes"
>> -                    BR_CONFIG="$BR_CONFIG\nset $BR_ROOT/IPV6FORWARDING no"
>> -                    BR_CONFIG="$BR_CONFIG\nset $BR_ROOT/IPV6AUTOCONF yes"
>> -                    ;;
>> -                A|a)
>> -                    CONFIGURED_NIC=""
>> -                    VLAN_ID=""
>> -                    return
>> -                    ;;
>> -            esac
>> +
>> +            while true; do
>> +                read -ep "Enable IPv6 support ([S]tatic, [D]HCPv6, A[u]to, [N]o or [A]bort)? "
>> +                case $REPLY in
>> +                    S|s)
>> +                        read -ep "IPv6 Address: "; IPADDR=$REPLY
>> +                        BR_CONFIG="$BR_CONFIG\nset $BR_ROOT/IPV6INIT yes"
>> +                        BR_CONFIG="$BR_CONFIG\nset $BR_ROOT/IP6ADDR $IPADDR"
>> +                        break
>> +                        ;;
>> +                    D|d)
>> +                        BR_CONFIG="$BR_CONFIG\nset $BR_ROOT/IPV6INIT yes"
>> +                        BR_CONFIG="$BR_CONFIG\nset $BR_ROOT/IPV6AUTCONF no"
>> +                        BR_CONFIG="$BR_CONFIG\nset $BR_ROOT/IPV6FORWARDING no"
>> +                        BR_CONFIG="$BR_CONFIG\nset $BR_ROOT/DHCPV6C yes"
>> +                        break
>> +                        ;;
>> +                    U|u)
>> +                        BR_CONFIG="$BR_CONFIG\nset $BR_ROOT/IPV6INIT yes"
>> +                        BR_CONFIG="$BR_CONFIG\nset $BR_ROOT/IPV6FORWARDING no"
>> +                        BR_CONFIG="$BR_CONFIG\nset $BR_ROOT/IPV6AUTOCONF yes"
>> +                        break
>> +                        ;;
>> +                    A|a)
>> +                        CONFIGURED_NIC=""
>> +                        VLAN_ID=""
>> +                        return
>> +                        ;;
>> +                esac
>> +            done
>>     
>
> NAK.
>
> This portion is missing support for [N]o on IPv6 support.
>
>   
interesting, it was never there to begin with :/ I'll add it




More information about the ovirt-devel mailing list