e83fb1
diff -up dhcp-4.3.0a1/client/dhclient.c.gpxe-cid dhcp-4.3.0a1/client/dhclient.c
e83fb1
--- dhcp-4.3.0a1/client/dhclient.c.gpxe-cid	2013-12-20 13:28:45.105048317 +0100
e83fb1
+++ dhcp-4.3.0a1/client/dhclient.c	2013-12-20 13:28:45.109048261 +0100
bd3a57
@@ -58,6 +58,13 @@ const char *path_dhclient_pid = NULL;
bd3a57
 static char path_dhclient_script_array[] = _PATH_DHCLIENT_SCRIPT;
bd3a57
 char *path_dhclient_script = path_dhclient_script_array;
bd3a57
 
bd3a57
+/* Default Prefix */
bd3a57
+static unsigned char default_prefix[12] = {
bd3a57
+	0xff, 0x00, 0x00, 0x00,
bd3a57
+	0x00, 0x00, 0x02, 0x00,
bd3a57
+	0x00, 0x02, 0xc9, 0x00
bd3a57
+};
bd3a57
+
bd3a57
 /* False (default) => we write and use a pid file */
bd3a57
 isc_boolean_t no_pid_file = ISC_FALSE;
bd3a57
 
e83fb1
@@ -1253,6 +1260,12 @@ int find_subnet (struct subnet **sp,
bd3a57
 static void setup_ib_interface(struct interface_info *ip)
bd3a57
 {
bd3a57
 	struct group *g;
bd3a57
+	struct hardware *hw = &ip->hw_address;
bd3a57
+	char client_id[64];
bd3a57
+	char *arg_conf = NULL;
bd3a57
+	int arg_conf_len = 0;
bd3a57
+	isc_result_t status;
bd3a57
+	struct parse *cfile = (struct parse *)0;
bd3a57
 
bd3a57
 	/* Set the broadcast flag */
bd3a57
 	ip->client->config->bootp_broadcast_always = 1;
e83fb1
@@ -1269,8 +1282,39 @@ static void setup_ib_interface(struct in
bd3a57
 		}
bd3a57
 	}
bd3a57
 
bd3a57
-	/* No client ID specified */
bd3a57
-	log_fatal("dhcp-client-identifier must be specified for InfiniBand");
bd3a57
+	/*
bd3a57
+	 * No client ID specified, make up one based on a default
bd3a57
+	 * "prefix" and the port GUID.
bd3a57
+	 *
bd3a57
+	 * NOTE: This is compatible with what gpxe does.
bd3a57
+	 */
bd3a57
+	sprintf(client_id, "%.2x:%.2x:%.2x:%.2x:%.2x:%.2x:%.2x:%.2x:%.2x:%.2x:%.2x:%.2x:%.2x:%.2x:%.2x:%.2x:%.2x:%.2x:%.2x:%.2x",
bd3a57
+		default_prefix[0], default_prefix[1], default_prefix[2],
bd3a57
+		default_prefix[3], default_prefix[4], default_prefix[5],
bd3a57
+		default_prefix[6], default_prefix[7], default_prefix[8],
bd3a57
+		default_prefix[9], default_prefix[10], default_prefix[11],
bd3a57
+		hw->hbuf[1], hw->hbuf[2], hw->hbuf[3], hw->hbuf[4],
bd3a57
+		hw->hbuf[5], hw->hbuf[6], hw->hbuf[7], hw->hbuf[8]);
bd3a57
+
bd3a57
+	arg_conf_len = asprintf(&arg_conf,
bd3a57
+				"send dhcp-client-identifier %s;",
bd3a57
+				client_id);
bd3a57
+
bd3a57
+	if ((arg_conf == 0) || (arg_conf_len <= 0))
bd3a57
+		log_fatal("Unable to send option dhcp-client-identifier");
bd3a57
+
bd3a57
+	status = new_parse(&cfile, -1, arg_conf, arg_conf_len,
bd3a57
+			   "Automatic Infiniband client identifier", 0);
bd3a57
+
bd3a57
+	if ((status != ISC_R_SUCCESS) || (cfile->warnings_occurred))
bd3a57
+		log_fatal("Failed to parse Infiniband client identifier");
bd3a57
+
bd3a57
+	parse_client_statement(cfile, NULL, ip->client->config);
bd3a57
+
bd3a57
+	if (cfile->warnings_occurred)
bd3a57
+		log_fatal("Failed to parse Infiniband client identifier");
bd3a57
+
bd3a57
+	end_parse(&cfile);
bd3a57
 }
bd3a57
 
bd3a57
 /* Individual States: