On Sun, 2005-03-20 at 14:44, Thomas Graf wrote:
> * Jamal Hadi Salim <1111345551.1095.82.camel@xxxxxxxxxxxxxxxx> 2005-03-20
> 14:05
> > +static inline int
> > +tcf_defact_init(struct rtattr *rta, struct rtattr *est,
> > + struct tc_action *a, int ovr, int bind)
> > +{
> > + struct rtattr *tb[TCA_DEF_MAX];
> > + struct tc_defact *parm;
> > + struct tcf_defact *p;
> > + void *defdata;
> > + u32 datalen = 0;
> > + int ret = 0;
> > +
> > + if (rta == NULL || rtattr_parse_nested(tb, TCA_DEF_MAX, rta) < 0)
> > + return -EINVAL;
> > +
> > + if (tb[TCA_DEF_PARMS - 1] == NULL)
> > + return -EINVAL;
> > + parm = RTA_DATA(tb[TCA_DEF_PARMS - 1]);
> > + defdata = RTA_DATA(tb[TCA_DEF_DATA - 1]);
>
> Maybe do a size sanity check here for TCA_DEF_PARMS?
>
Will do.
> > +
> > +struct tc_defact
> > +{
> > + tc_gen;
> > +};
>
> tcf_defact, tc_defact, .. quite easy to get this wrong. Maybe
> it would a good idea to rename tcf_defact to tcf_defact_parm?
>
sigh. another LinuxWay(tm). Unfortunately this is all over the net/sched
code to imply something thats user specific vs kernel specific. If
you feel strongly about it i will change it - otherwise maybe we can
leave it till some day some brave person will clean up the whole thing?
cheers,
jamal
|