[U-Boot] [PATCH v3 6/8] net/bootp: add VCI support for BOOTP also

Ilya Yanok ilya.yanok at cogentembedded.com
Wed Jul 25 20:33:02 CEST 2012


Hi Joe,

On Wed, Jul 25, 2012 at 3:29 AM, Joe Hershberger
<joe.hershberger at gmail.com>wrote:

>
> > +#define put_vci(e, str)                                \
> > +       do {                                    \
> > +               *e++ = 60;                      \
>
>
> Please keep the comment on the magic number.
>

Sure.


>
> > +               *e++ = sizeof(str);             \
>
> Did you mean to change this from strlen() to sizeof()?  These are not
> the same thing.
>

Good catch, will change it.


>
> > +               memcpy(e, str, sizeof(str));    \
> > +               e += sizeof(str);               \
> > +       } while (0)
> > +
> >  /*
> >   *     Initialize BOOTP extension fields in the request.
> >   */
> > @@ -435,12 +443,10 @@ static int DhcpExtended(u8 *e, int message_type,
> IPaddr_t ServerID,
> >                         printf("Invalid pxeuuid: %s\n", uuid);
> >                 }
> >         }
> > +#endif
> >
> > -       *e++ = 60;      /* Vendor Class Identifier */
> > -       vci_strlen = strlen(CONFIG_BOOTP_VCI_STRING);
>
> If you aren't using this anymore, then you should remove size_t
> vci_strlen; from the top of the file.
>

Will move it inside macro.

Regards, Ilya.


More information about the U-Boot mailing list