[ipxe-devel] ipxe and client_id

Sergey Urushkin urushkin at telros.ru
Wed Dec 4 12:28:48 UTC 2013


Hi!
I wonder are there any plans to implement an option to disable
DHCP_CLIENT_ID sending via scripts or 'make' arguments? For now I need
to patch sources to
disable client-id.

I see at least 2 cases where it could be useful (ethernet and isc-dhcpd
related):
1. If you want ipxe to get the same ip address as NIC's pxe rom (which
doesn't send client-id) after chaining. E.g. If you have small dhcp pool
for pxe booting.
2. isc-dhcpd configuration: sending client-id by iPXE makes meaningless
using "option dhcp-client-identifier and fixed-address" in "host"
statement. E.g. if you want to get some static address after booting,
but don't want it while booting (ipxe scripts and other boot files are
only accessible from special pxe-pool of addresses).

It could be (embed)script variable:
set client-id 0

To just disable client-id sending, I use this patch:

--- src/net/udp/dhcp.c.orig    2013-11-27 10:40:42.000000000 +0400
+++ src/net/udp/dhcp.c    2013-11-27 10:42:19.409271068 +0400
@@ -970,11 +970,11 @@
               uint32_t xid, struct in_addr ciaddr,
               void *data, size_t max_len ) {
     struct dhcp_netdev_desc dhcp_desc;
-    struct dhcp_client_id client_id;
+//    struct dhcp_client_id client_id;
     struct dhcp_client_uuid client_uuid;
     uint8_t *dhcp_features;
     size_t dhcp_features_len;
-    size_t ll_addr_len;
+//    size_t ll_addr_len;
     ssize_t len;
     int rc;
 @@ -1014,7 +1014,7 @@
     /* Add DHCP client identifier.  Required for Infiniband, and
      * doesn't hurt other link layers.
      */
-    client_id.ll_proto = ntohs ( netdev->ll_protocol->ll_proto );
+/*    client_id.ll_proto = ntohs ( netdev->ll_protocol->ll_proto );
     ll_addr_len = netdev->ll_protocol->ll_addr_len;
     assert ( ll_addr_len <= sizeof ( client_id.ll_addr ) );
     memcpy ( client_id.ll_addr, netdev->ll_addr, ll_addr_len );
@@ -1023,7 +1023,7 @@
         DBG ( "DHCP could not set client ID: %s\n",
               strerror ( rc ) );
         return rc;
-    }
+    }*/
      /* Add client UUID, if we have one.  Required for PXE.  The
      * PXE spec does not specify a byte ordering for UUIDs, but


Thank you!

-- 
Best regards,
Sergey Urushkin




More information about the ipxe-devel mailing list