[PATCH 1/8] net: dhcp: factorise option recption handling

Sascha Hauer s.hauer at pengutronix.de
Tue Apr 3 02:57:57 EDT 2012


On Tue, Apr 03, 2012 at 06:55:54AM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote:
> On 21:02 Mon 02 Apr     , Sascha Hauer wrote:
> > On Mon, Apr 02, 2012 at 04:19:03PM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote:
> > > Instead of using a static switch case the handle the received option
> > > use an array of supported option.
> > > 
> > > This will allow to unset the env var without duplicating the code.
> > > 
> > > Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj at jcrosoft.com>
> > 
> > Much better, thanks.
> > 
> > > +struct dhcp_opt {
> > > +	unsigned char option;
> > > +	const char *barebox_var_name;
> > > +	void (*handle)(struct dhcp_opt *opt, unsigned char *data, int tlen);
> > > +	void *data;
> > > +
> > > +	/* request automatically the option when creating the DHCP request */
> > > +	bool optinal;
> > 
> > s/optinal/optional/?
> > 
> > You can optimize the size of this struct a bit by putting this bool
> > after the unsigned char above.
> branch updated with it

Pulled, thanks

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



More information about the barebox mailing list