Corrected version below.
+ printk(KERN_INFO "Sending class identifier \"%s\"\n",Seems like useless noise.
+ vendor_class_identifier);
This information is only sent in the case that the option is actually used.
And in this case it might be useful for the user to see to which string the option was set.
@@ -580,6 +582,7 @@ ic_dhcp_init_options(u8 *options)
u8 mt = ((ic_servaddr == NONE)
? DHCPDISCOVER : DHCPREQUEST);
u8 *e = options;
+ int len = 0;
#ifdef IPCONFIG_DEBUG
printk("DHCP: Sending message type %d\n", mt);
@@ -620,6 +623,16 @@ ic_dhcp_init_options(u8 *options)
*e++ = sizeof(ic_req_params);
memcpy(e, ic_req_params, sizeof(ic_req_params));
e += sizeof(ic_req_params);
+
+ if (*vendor_class_identifier) {
+ printk(KERN_INFO "Sending class identifier \"%s\"\n",
+ vendor_class_identifier);
+ *e++ = 60; /* Class-identifier */
+ len = strlen(vendor_class_identifier);
+ *e++ = len;
+ memcpy(e, vendor_class_identifier, len);
+ e += len;
+ }
}
*e++ = 255; /* End of the list */
@@ -1507,5 +1520,16 @@ static int __init nfsaddrs_config_setup(
return ip_auto_config_setup(addrs);
}
+static int __init vendor_class_identifier_setup(char *addrs)
+{
+ if (strlcpy(vendor_class_identifier, addrs,
+ sizeof(vendor_class_identifier))
+ > sizeof(vendor_class_identifier))
+ printk(KERN_WARNING "vendorclass too long, truncated to \"%s\"",
+ vendor_class_identifier);