View | Details | Raw Unified | Return to bug 775 | Differences between
and this patch

Collapse All | Expand All

(-)deattack.c (-1 / +8 lines)
Lines 33-39 RCSID("$OpenBSD: deattack.c,v 1.19 2003/ Link Here
33
33
34
/* Hashing constants */
34
/* Hashing constants */
35
#define HASH_MINSIZE	(8 * 1024)
35
#define HASH_MINSIZE	(8 * 1024)
36
#define HASH_ENTRYSIZE	(2)
36
#define HASH_ENTRYSIZE	(sizeof(u_int16_t))
37
#define HASH_FACTOR(x)	((x)*3/2)
37
#define HASH_FACTOR(x)	((x)*3/2)
38
#define HASH_UNUSEDCHAR	(0xff)
38
#define HASH_UNUSEDCHAR	(0xff)
39
#define HASH_UNUSED	(0xffff)
39
#define HASH_UNUSED	(0xffff)
Lines 128-134 detect_attack(u_char *buf, u_int32_t len Link Here
128
		}
128
		}
129
		return (DEATTACK_OK);
129
		return (DEATTACK_OK);
130
	}
130
	}
131
132
#ifndef _UNICOS
131
	memset(h, HASH_UNUSEDCHAR, n * HASH_ENTRYSIZE);
133
	memset(h, HASH_UNUSEDCHAR, n * HASH_ENTRYSIZE);
134
#else
135
	/* we can't use memset because the entries aren't 2 bytes */
136
	for (i= 0; i < n; i++)
137
		h[i] = HASH_UNUSED;
138
#endif
132
139
133
	if (IV)
140
	if (IV)
134
		h[HASH(IV) & (n - 1)] = HASH_IV;
141
		h[HASH(IV) & (n - 1)] = HASH_IV;

Return to bug 775