]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Fix last patch after testing
authorRoy Marples <roy@marples.name>
Thu, 25 Jul 2013 15:39:38 +0000 (15:39 +0000)
committerRoy Marples <roy@marples.name>
Thu, 25 Jul 2013 15:39:38 +0000 (15:39 +0000)
dhcpcd-hooks/30-hostname
if-options.c

index 6098f6205843c52987a57f753619af0ed2c9b49b..a2c22f63152d89e8aaeaf8c4d49fe61b328cf2fe 100644 (file)
@@ -96,17 +96,18 @@ try_hostname()
 
 set_hostname()
 {
-       local hfqdn
+       local hfqdn=false hshort=false
 
        need_hostname || return
 
        case "$hostname_fqdn" in
        [Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|1)        hfqdn=true;;
-       *)                                      hfqdn=false;;
+       "")                                     ;;
+       *)                                      hshort=true;;
        esac
 
        if [ -n "$new_fqdn" ]; then
-               if ${hfqdn} || ! ${hsort}; then
+               if ${hfqdn} || ! ${hshort}; then
                        try_hostname "$new_fqdn"
                else
                        try_hostname "${new_fqdn%%.*}"
index 9f359954110a208613b310a8818d20a49203d2eb..34f35e5c9641e7dc934c36c02a1de7c3aaa2c008 100644 (file)
@@ -1082,7 +1082,7 @@ got_iaid:
                }
                break;
        case O_HOSTNAME_SHORT:
-               ifo->options |= DHCPCD_HOSTNAME_SHORT;
+               ifo->options |= DHCPCD_HOSTNAME | DHCPCD_HOSTNAME_SHORT;
                break;
 #endif
        default: