[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140115151008.GD6638@osiris>
Date: Wed, 15 Jan 2014 16:10:08 +0100
From: Heiko Carstens <heiko.carstens@...ibm.com>
To: Eric Dumazet <eric.dumazet@...il.com>
Cc: Hannes Frederic Sowa <hannes@...essinduktion.org>,
netdev@...r.kernel.org, dborkman@...hat.com,
darkjames-ws@...kjames.pl, Mircea Gherzan <mgherzan@...il.com>,
Russell King <rmk+kernel@....linux.org.uk>,
Matt Evans <matt@...abs.org>,
Martin Schwidefsky <schwidefsky@...ibm.com>
Subject: Re: [PATCH net] bpf: do not use reciprocal divide
On Wed, Jan 15, 2014 at 06:16:38AM -0800, Eric Dumazet wrote:
> On Wed, 2014-01-15 at 09:00 +0100, Heiko Carstens wrote:
> > Are you sure you want to remove the k == 0 check? Is there something
> > else that would prevent a division by zero?
>
> This is done by factoring the two cases, modulo and divide :
>
> vi +553 net/core/filter.c
>
> /* Some instructions need special checks */
> switch (code) {
> case BPF_S_ALU_DIV_K:
> case BPF_S_ALU_MOD_K:
> /* check for division by zero */
> if (ftest->k == 0)
> return -EINVAL;
> break;
Oh, sorry. I missed the fallthrough.
--
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