|
@@ -146,6 +146,10 @@ u8 root_server_path[256] = { 0, }; /* Path to mount as root */
|
|
|
/* vendor class identifier */
|
|
/* vendor class identifier */
|
|
|
static char vendor_class_identifier[253] __initdata;
|
|
static char vendor_class_identifier[253] __initdata;
|
|
|
|
|
|
|
|
|
|
+#if defined(CONFIG_IP_PNP_DHCP)
|
|
|
|
|
+static char dhcp_client_identifier[253] __initdata;
|
|
|
|
|
+#endif
|
|
|
|
|
+
|
|
|
/* Persistent data: */
|
|
/* Persistent data: */
|
|
|
|
|
|
|
|
static int ic_proto_used; /* Protocol used, if any */
|
|
static int ic_proto_used; /* Protocol used, if any */
|
|
@@ -728,6 +732,16 @@ ic_dhcp_init_options(u8 *options)
|
|
|
memcpy(e, vendor_class_identifier, len);
|
|
memcpy(e, vendor_class_identifier, len);
|
|
|
e += len;
|
|
e += len;
|
|
|
}
|
|
}
|
|
|
|
|
+ len = strlen(dhcp_client_identifier + 1);
|
|
|
|
|
+ /* the minimum length of identifier is 2, include 1 byte type,
|
|
|
|
|
+ * and can not be larger than the length of options
|
|
|
|
|
+ */
|
|
|
|
|
+ if (len >= 1 && len < 312 - (e - options) - 1) {
|
|
|
|
|
+ *e++ = 61;
|
|
|
|
|
+ *e++ = len + 1;
|
|
|
|
|
+ memcpy(e, dhcp_client_identifier, len + 1);
|
|
|
|
|
+ e += len + 1;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
*e++ = 255; /* End of the list */
|
|
*e++ = 255; /* End of the list */
|
|
@@ -1557,8 +1571,24 @@ static int __init ic_proto_name(char *name)
|
|
|
return 0;
|
|
return 0;
|
|
|
}
|
|
}
|
|
|
#ifdef CONFIG_IP_PNP_DHCP
|
|
#ifdef CONFIG_IP_PNP_DHCP
|
|
|
- else if (!strcmp(name, "dhcp")) {
|
|
|
|
|
|
|
+ else if (!strncmp(name, "dhcp", 4)) {
|
|
|
|
|
+ char *client_id;
|
|
|
|
|
+
|
|
|
ic_proto_enabled &= ~IC_RARP;
|
|
ic_proto_enabled &= ~IC_RARP;
|
|
|
|
|
+ client_id = strstr(name, "dhcp,");
|
|
|
|
|
+ if (client_id) {
|
|
|
|
|
+ char *v;
|
|
|
|
|
+
|
|
|
|
|
+ client_id = client_id + 5;
|
|
|
|
|
+ v = strchr(client_id, ',');
|
|
|
|
|
+ if (!v)
|
|
|
|
|
+ return 1;
|
|
|
|
|
+ *v = 0;
|
|
|
|
|
+ if (kstrtou8(client_id, 0, dhcp_client_identifier))
|
|
|
|
|
+ DBG("DHCP: Invalid client identifier type\n");
|
|
|
|
|
+ strncpy(dhcp_client_identifier + 1, v + 1, 251);
|
|
|
|
|
+ *v = ',';
|
|
|
|
|
+ }
|
|
|
return 1;
|
|
return 1;
|
|
|
}
|
|
}
|
|
|
#endif
|
|
#endif
|