dhcpcd-discuss

RE: Does old_fqdn take on the value of new_dhcp6_fqdn?

Walrath, Paul

Fri Aug 14 17:29:31 2015

Perhaps what is needed is something like this:


        if [ -n "$old_dhpc6_fqdn" ]; then

               if ${hfqdn} || ! ${hsort}; then

                       [ "$hostname" = "$old_dhcp6_fqdn" ]

               else

                       [ "$hostname" = "${old_dhcp6_fqdn%%.*}" ]

               fi

        elif if [ -n "$old_fqdn" ]; then

               if ${hfqdn} || ! ${hsort}; then

                       [ "$hostname" = "$old_fqdn" ]

               else

                       [ "$hostname" = "${old_fqdn%%.*}" ]

               fi

        elif [ -n "$old_host_name" ]; then


From: Walrath, Paul [mailto:paul.walrath@xxxxxx]
Sent: Friday, August 14, 2015 10:24 AM
To: dhcpcd-discuss@xxxxxxxxxxxx
Subject: [dhcpcd-discuss] Does old_fqdn take on the value of new_dhcp6_fqdn?

Hi Roy,

In the 30-hostname hook script there is the following:

# For ease of use, map DHCP6 names onto our DHCP4 names
case "$reason" in
BOUND6|RENEW6|REBIND6|REBOOT6|INFORM6)
        new_fqdn="$new_dhcp6_fqdn"
        ;;
esac

The next time this script is run, does $old_fqdn have the value remembered from $new_dhcp6_fqdn or is it still set to the $new_fqdn value from processing a previous DHCPv4 reply?

If the $new_dhcp6_fqdn value is not used for $old_fqdn, then I think some of the code in 30-hostname won't run correctly.  Specifically this part in need_hostname():


        if [ -n "$old_fqdn" ]; then

               if ${hfqdn} || ! ${hsort}; then

                       [ "$hostname" = "$old_fqdn" ]

               else

                       [ "$hostname" = "${old_fqdn%%.*}" ]

               fi

        elif [ -n "$old_host_name" ]; then

Paul Walrath




Follow-Ups:
RE: Does old_fqdn take on the value of new_dhcp6_fqdn?Walrath, Paul
References:
Does old_fqdn take on the value of new_dhcp6_fqdn?Walrath, Paul
Archive administrator: postmaster@marples.name