From: Roy Marples Date: Fri, 28 Jun 2013 16:42:29 +0000 (+0000) Subject: Cater for non RFC conformant domains in the hostname field. X-Git-Tag: v6.0.3~5 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=97aad6a3d1813c368f1f696eab12c5f774a21448;p=thirdparty%2Fdhcpcd.git Cater for non RFC conformant domains in the hostname field. --- diff --git a/dhcpcd-hooks/30-hostname b/dhcpcd-hooks/30-hostname index 77ae5fce..ede7503b 100644 --- a/dhcpcd-hooks/30-hostname +++ b/dhcpcd-hooks/30-hostname @@ -71,7 +71,11 @@ set_hostname() if [ -n "$new_fqdn_name" ]; then try_hostname "$new_fqdn_name" elif [ -n "$new_host_name" ]; then - if [ -n "$new_domain_name" ]; then + # Could be non RFC conformant domain in the + # hostname field + if [ -n "$new_domain_name" -a \ + "$new_host_name" = "${new_host_name#*.}" ] + then try_hostname "$new_host_name.$new_domain_name" else try_hostname "$new_host_name"