[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <u7QxWWtde55Y9LShpj3u0U9TJnSF0kslGDC8-MLt7BkKYwuy-YcDvvr3lHGf81Rq6ubcvZu0fQ2OMmyWdaGp08UgovYZYKl3N9BNps0IEho=@protonmail.com>
Date: Fri, 31 Jan 2020 00:58:00 +0000
From: Ttttabcd <ttttabcd@...tonmail.com>
To: Michal Kubecek <mkubecek@...e.cz>
Cc: "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
Eric Dumazet <edumazet@...gle.com>,
David Miller <davem@...emloft.net>,
"kuznet@....inr.ac.ru" <kuznet@....inr.ac.ru>,
"yoshfuji@...ux-ipv6.org" <yoshfuji@...ux-ipv6.org>
Subject: Re: [RFC] tcp: syncookies: Interesting serious errors when generating and verification cookies
> What I don't understand is that even if you yourself concluded that the
> implementation provides correct result for any possible values, you
> still insist on calling it "wrong". Why?
I used to think this was a coincidence, so I always thought it was a "clever" bug.
> Rather than "coincidence", I would call this optimization based on
> trivial identity
> (a - b % m) % m = (a - b) % m
>
> together with the usual trick that if m is a power of two, "% m" is
> equivalent to "& (m - 1)". To put it simply, if we know we are going to
> mask out upper bits eventually, there is no reason to do the same with
> one of the operands before the subtraction.
Thank you, I now know this is an optimization.
Powered by blists - more mailing lists