dhcpcd-discuss

RE: Does old_fqdn take on the value of new_dhcp6_fqdn?

Walrath, Paul

Fri Aug 14 18:01:42 2015

Actually, I'm starting to doubt if this is even an issue at all.  :)
I need to do more testing.  Roy, perhaps you can confirm that
this script is working properly as written.

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

I don't think what I posted will work.  The need_hostname() test logic must deal with both $old_fqdn and $old_dhcp6_fqdn existing at the same time.  The host name is set from the most recently received FQDN.

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

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<mailto: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




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