summaryrefslogtreecommitdiff
path: root/net/chrony/patches/patch-ah
blob: dff29fb53529796f74cb32f2e726141fcd066170 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
$NetBSD: patch-ah,v 1.1 2007/11/30 22:53:54 rillig Exp $

Resolved recursive data type.

--- addrfilt.c.orig	2002-02-28 23:27:08.000000000 +0000
+++ addrfilt.c	2007-11-30 22:49:50.000000000 +0000
@@ -43,15 +43,11 @@
 /* Define the table size */
 #define TABLE_SIZE (1UL<<NBITS)
 
-struct _TableNode;
-
-typedef struct _TableNode ExtendedTable[TABLE_SIZE];
-
 typedef enum {DENY, ALLOW, AS_PARENT} State;
 
-typedef struct _TableNode {
+typedef struct TableNode {
   State state;
-  ExtendedTable *extended;
+  struct TableNode **extended;	/* [TABLE_SIZE] */
 } TableNode;
 
 struct ADF_AuthTableInst {
@@ -124,7 +120,7 @@ open_node(TableNode *node)
 
   if (node->extended == NULL) {
 
-    node->extended = MallocNew(ExtendedTable);
+    node->extended = malloc(sizeof(*node->extended) * TABLE_SIZE);
 
     for (i=0; i<TABLE_SIZE; i++) {
       child_node = &((*(node->extended))[i]);