Call for testing for 3.5 OpenSSH
Ben Lindstrom
mouring at etoh.eviladmin.org
Wed Sep 25 05:08:06 EST 2002
On Tue, 24 Sep 2002, Michael Tokarev wrote:
> Ben Lindstrom wrote:
>
> []
> >>*** 101,111 ****
> >>--- 101,119 ----
> >> if (h == NULL) {
> >> debug("Installing crc compensation attack detector.");
> >> n = l;
> >>+ #if defined(_CRAY) && !defined(_CRAYSV2)
> >>+ h = (u_int16_t *) xmalloc(n * sizeof(u_int16_t));
> >>+ #else
> >> h = (u_int16_t *) xmalloc(n * HASH_ENTRYSIZE);
> >>+ #endif /* _CRAY */
> >> } else {
> >> if (l > n) {
> >> n = l;
> >>+ #if defined(_CRAY) && !defined(_CRAYSV2)
> >>+ h = (u_int16_t *) xrealloc(h, n * sizeof(u_int16_t));
> >>+ #else
> >> h = (u_int16_t *) xrealloc(h, n * HASH_ENTRYSIZE);
> >>+ #endif /* _CRAY */
>
> etc etc. I think this way will be *much* simpler:
>
> #if defined(_CRAY) && ! defined(_CRAYSV2)
> #include <ia.h>
> #define HASH_ENTRYSIZE sizeof(u_int16_t)
> #define HASH_UNUSEDCHAR (HASH_UNUSED>>8)
> #endif /* _CRAY */
>
> and just forgot about this whole hunk?
>
No.. If I'm not mistaken (Please, Wendy correct me if I'm wrong) there
are other aspects of the code where the #define's are correct. And
that is part of the issue here. This has been talked about over the last
year or so.
> Also, instead of repeating "#if defined(_CRAY) && ! defined(_CRAYSV2)",
> will it be better to use something like
>
> #if defined(_CRAY) && ! defined(_CRAYSV2)
> # define _CRAY_IA
> #endif
>
> and use #if _CRAY_IA (or whatether) in the rest of places?
>
Would be better if we could do #ifdef HAVE_XXX and not have to handle it
the current way. However, if it can't be done I'd rather see the
Defines() && !define() instead of go digging around looking for this
mythical '_CRAY_IA'. From a coding view point it is a one off operation
and makes it hard to track code.
- Ben
More information about the openssh-unix-dev
mailing list