[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1341238375.11881.16.camel@lolumad>
Date: Mon, 02 Jul 2012 16:12:55 +0200
From: Rostislav Lisovy <lisovy@...il.com>
To: Oliver Hartkopp <socketcan@...tkopp.net>
Cc: netdev@...r.kernel.org, linux-can@...r.kernel.org,
lartc@...r.kernel.org, pisa@....felk.cvut.cz, sojkam1@....cvut.cz
Subject: Re: [PATCH net-next] em_canid: Ematch rule to match CAN frames
according to their identifiers
Hello Oliver;
On Fri, 2012-06-29 at 17:44 +0200, Oliver Hartkopp wrote:
> What about a zero length check here?
>
> if (!len)
> return -EINVAL;
>
>
> The length could alternatively be checked here too
>
> http://lxr.linux.no/#linux+v3.4.4/net/sched/ematch.c#L235
>
> if em->ops->datalen is set.
>
> But here's no
>
> .datalen = sizeof(struct can_filter),
>
> defined, right?
>
The main reason I didn't define the tcf_ematch_ops.datalen field is
because the documentation says it is "length of expected configuration
data" (not "minimal").
For the sake of possible future changes of the built-in length checking,
I will do the check by myself -- I will add the zero-length check (at
least all checks will be at the same place).
Regards;
Rostislav
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists