why is dhclient fqdn options processing & client_dns_update disabled (client->sent_options = 0L) ?

Jason Vas Dias jvdias at redhat.com
Mon Aug 16 21:56:36 UTC 2004


Actually, it's probably a good idea to check if sent_options
is non-zero before de-referencing .
Here is the patch I used, against version from dhcp-3.0.1.tar.gz :

__BEGIN PATCH__
--- dhcp-3.0.1/client/dhclient.c.preserve-sent-options  2004-07-09 20:11:16.000000000 -0400
+++ dhcp-3.0.1/client/dhclient.c        2004-08-16 17:50:41.922782000 -0400
@@ -1945,6 +1945,9 @@
                                    DHO_DHCP_SERVER_IDENTIFIER);
        else
                oc = (struct option_cache *)0;
+
+       if( client->sent_options != 0L )
+           option_state_dereference (&client -> sent_options, MDL);

        make_client_options (client, lease, &request, oc,
                             ((client -> state == S_REQUESTING ||
@@ -1968,7 +1971,6 @@
                              (struct data_string *)0,
                              client -> config -> vendor_space_name);

-       option_state_dereference (&client -> sent_options, MDL);
        if (client -> packet_length < BOOTP_MIN_LEN)
                client -> packet_length = BOOTP_MIN_LEN;
__END PATCH__
On Mon, 2004-08-16 at 17:39, Martin Blapp wrote:
> Hi,
> 
> Do you mean a patch like this one ?
> 
> Martin
> 
> > sorry, but i wasn't aware of this bug until it was too late to
> > include in 3.0.1.
> >
> 
> Index: dhclient.c
> ===================================================================
> RCS file: /home/ncvs/src/contrib/isc-dhcp/client/dhclient.c,v
> retrieving revision 1.42
> diff -u -r1.42 dhclient.c
> --- dhclient.c  16 Aug 2004 21:26:04 -0000      1.42
> +++ dhclient.c  16 Aug 2004 21:39:15 -0000
> @@ -2065,6 +2065,7 @@
>         unsigned char *old_digest_loc;
>         struct option_cache *oc;
> 
> +       option_state_dereference (&client -> sent_options, MDL);
>         memset (&client -> packet, 0, sizeof (client -> packet));
> 
>         if (client -> state == S_REQUESTING)
> @@ -2095,7 +2096,6 @@
>                               (struct data_string *)0,
>                               client -> config -> vendor_space_name);
> 
> -       option_state_dereference (&client -> sent_options, MDL);
>         if (client -> packet_length < BOOTP_MIN_LEN)
>                 client -> packet_length = BOOTP_MIN_LEN;
> 



More information about the dhcp-hackers mailing list