From: Patrick McHardy <kaber@trash.net>
To: Rainer Jochem <rainer.jochem@mpi-sb.mpg.de>
Cc: davem@davemloft.net, kuznet@ms2.inr.ac.ru, jmorris@namei.org,
linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
pcernko@mpi-sws.mpg.de
Subject: Re: [PATCH] ipconfig.c : implement DHCP Class-identifier
Date: Wed, 14 Nov 2007 09:56:15 +0100 [thread overview]
Message-ID: <473AB82F.8050801@trash.net> (raw)
In-Reply-To: <20071114084420.GA29241@mpi-sb.mpg.de>
Rainer Jochem wrote:
> Corrected version below.
>
>>> + printk(KERN_INFO "Sending class identifier \"%s\"\n",
>>> + vendor_class_identifier);
>> Seems like useless noise.
>
> 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.
I don't think its very useful since you can simply get this information
from /proc/cmdline in case something goes wrong, but if you insist at
least give it a meaningful prefix.
> @@ -580,6 +582,7 @@ ic_dhcp_init_options(u8 *options)
> u8 mt = ((ic_servaddr == NONE)
> ? DHCPDISCOVER : DHCPREQUEST);
> u8 *e = options;
> + int len = 0;
The initialization is unnecessary.
> #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);
Should be >= I think.
next prev parent reply other threads:[~2007-11-14 8:56 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-08 14:32 [PATCH] ipconfig.c : implement DHCP Class-identifier Rainer Jochem
2007-11-08 15:45 ` Patrick McHardy
2007-11-14 8:44 ` Rainer Jochem
2007-11-14 8:56 ` Patrick McHardy [this message]
2007-11-14 9:45 ` Rainer Jochem
2007-11-14 9:48 ` Patrick McHardy
2007-11-14 10:18 ` David Miller
2007-11-14 22:11 ` Francois Romieu
2007-11-20 5:56 ` David Miller
2007-11-08 20:27 ` Ilpo Järvinen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=473AB82F.8050801@trash.net \
--to=kaber@trash.net \
--cc=davem@davemloft.net \
--cc=jmorris@namei.org \
--cc=kuznet@ms2.inr.ac.ru \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pcernko@mpi-sws.mpg.de \
--cc=rainer.jochem@mpi-sb.mpg.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.