From: Steve Graegert <graegerts@gmail.com>
To: linux-c-programming <linux-c-programming@vger.kernel.org>
Subject: Re: Question about the syncookie_secret[] in syncookies.c
Date: Tue, 17 Jan 2006 15:24:34 +0100 [thread overview]
Message-ID: <6a00c8d50601170624j1861e66esb7617559fd52a356@mail.gmail.com> (raw)
In-Reply-To: <6ff3e7140601170610m1452cb49v@mail.gmail.com>
On 1/17/06, openbsd shen <openbsd.shen@gmail.com> wrote:
> In /usr/src/linux/net/ipv4/syncookies.c, there are 2 lines:
>
> static __u32 syncookie_secret[2][16-3+SHA_DIGEST_WORDS];
> #define SHA_DIGEST_WORDS 5
>
> As we know 16-3+5 = 18, why not use syncookie_secret[2][18] directly ?
Because it is good practice to define constants, which are used in
multiple places, only once (here: SHA_DIGEST_WORDS is defined in
<linux/cryptohash.h>) . It eases maintenance of code significantly.
\Steve
--
Steve Graegert <graegerts@gmail.com>
Software Consultant {C/C++ && Java && .NET}
Office: +49 9131 7123988
Mobile: +49 1520 9289212
prev parent reply other threads:[~2006-01-17 14:24 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-01-17 14:10 Question about the syncookie_secret[] in syncookies.c openbsd shen
2006-01-17 14:24 ` Steve Graegert [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6a00c8d50601170624j1861e66esb7617559fd52a356@mail.gmail.com \
--to=graegerts@gmail.com \
--cc=linux-c-programming@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).