[prev in list] [next in list] [prev in thread] [next in thread] 

List:       dhcp-client
Subject:    require failed - patch
From:       Martin Walter <mawa () uni-freiburg ! de>
Date:       2003-03-14 15:57:41
[Download RAW message or body]

   *** From dhcp-client -- To unsubscribe, see the end of this message. ***

Hi,

just I had a problem with a diskless client on a subnet where
an other dhcp server runs. I wanted prevent my client from binding
to the foreign dhcp server. So I used a "require root-path" and got:

DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 4
DHCPOFFER from 132.230.4.222: no root-path option.
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 5
DHCPOFFER from 132.230.4.222: no root-path option.
DHCPOFFER from 132.230.1.12
DHCPREQUEST on eth0 to 255.255.255.255 port 67
DHCPACK from 132.230.4.222
bound to 132.230.4.1 -- renewal in 1777 seconds.

The require was obviously only recognized at the DHCPOFFER but not at
the DHCPACK. So I just patched the source and now it works for me:

DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 4
DHCPOFFER from 132.230.4.222: no root-path option.
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 4
DHCPOFFER from 132.230.4.222: no root-path option.
DHCPOFFER from 132.230.1.12
DHCPREQUEST on eth0 to 255.255.255.255 port 67
DHCPACK from 132.230.4.222: no root-path option.
DHCPACK from 132.230.1.12
bound to 132.230.4.1 -- renewal in 1532 seconds.

The patch is just:

#########################################################################
diff -u -b -r dhcp-3.0pl2/client/dhclient.c dhcp-3.0pl2.orig/client/dhclient.c
--- dhcp-3.0pl2/client/dhclient.c       2003-03-14 16:33:03.000000000 +0100
+++ dhcp-3.0pl2.orig/client/dhclient.c  2001-08-08 16:46:14.000000000 +0200
@@ -694,9 +694,6 @@
         struct option_cache *oc;
         struct data_string ds;
         int i;
-        const char *name = packet -> packet_type ? "DHCPACK" : "BOOTREPLY";
-        char obuf [1024];
-

         /* If we're not receptive to an offer right now, or if the offer
            has an unrecognizable transaction id, then just drop it. */
@@ -715,31 +712,6 @@
                 return;
         }

-
-
-        sprintf (obuf, "%s from %s", name, piaddr (packet -> client_addr));
-
-
-        /* If this lease doesn't supply the minimum required parameters,
-           blow it off. */
-        if (client -> config -> required_options) {
-            for (i = 0; client -> config -> required_options [i]; i++) {
-                if (!lookup_option
-                    (&dhcp_universe, packet -> options,
-                     client -> config -> required_options [i])) {
-                    log_info ("%s: no %s option.",
-                              obuf, (dhcp_universe.options
-                                     [client -> config -> required_options [i]]
-                                     -> name));
-                                return;
-                        }
-                }
-        }
-
-
-
-
-
         if (client -> state != S_REBOOTING &&
             client -> state != S_REQUESTING &&
             client -> state != S_RENEWING &&
#########################################################################


Best regards,
Martin.

-- 
Martin Walter
University of Freiburg i.Br. --- Germany --- Fon/Fax: +49 761 203-4651/-4643
Rechenzentrum der Universitaet, Hermann-Herder-Str.10, D-79104 Freiburg i.Br.

-----------------------------------------------------------------------
To unsubscribe from this list, visit http://www.isc.org/dhcp-lists.html
or send mail to dhcp-client-request@isc.org with the subject line of
'unsubscribe'.
-----------------------------------------------------------------------

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic