The RN_DEBUG code is broken since rev 1.1
I see no reason to keep it any longer and removing the code makes the
result easier to read.
OK?
--
:wq Claudio
Index: net/radix.c
===================================================================
RCS file: /cvs/src/sys/net/radix.c,v
retrieving revision 1.38
diff -u -p -r1.38 radix.c
--- net/radix.c 21 Jan 2014 23:42:44 -0000 1.38
+++ net/radix.c 22 Jan 2014 09:58:42 -0000
@@ -303,13 +303,6 @@ on1:
return NULL;
}
-#ifdef RN_DEBUG
-int rn_nodenum;
-struct radix_node *rn_clist;
-int rn_saveinfo;
-int rn_debug = 1;
-#endif
-
struct radix_node *
rn_newpair(void *v, int b, struct radix_node nodes[2])
{
@@ -322,13 +315,6 @@ rn_newpair(void *v, int b, struct radix_
tt->rn_key = v;
tt->rn_p = t;
tt->rn_flags = t->rn_flags = RNF_ACTIVE;
-#ifdef RN_DEBUG
- tt->rn_info = rn_nodenum++;
- t->rn_info = rn_nodenum++;
- tt->rn_twin = t;
- tt->rn_ybro = rn_clist;
- rn_clist = tt;
-#endif
return t;
}
@@ -376,10 +362,6 @@ on1:
else
x = x->rn_l;
} while (b > (unsigned int) x->rn_b); /* x->rn_b < b && x->rn_b >= 0 */
-#ifdef RN_DEBUG
- if (rn_debug)
- log(LOG_DEBUG, "rn_insert: Going In:\n"), traverse(p);
-#endif
t = rn_newpair(v_arg, b, nodes);
tt = t->rn_l;
if ((cp[p->rn_off] & p->rn_bmask) == 0)
@@ -394,10 +376,6 @@ on1:
t->rn_r = tt;
t->rn_l = x;
}
-#ifdef RN_DEBUG
- if (rn_debug)
- log(LOG_DEBUG, "rn_insert: Coming Out:\n"), traverse(p);
-#endif
}
return (tt);
}
@@ -640,14 +618,6 @@ rn_addroute(void *v_arg, void *n_arg, st
if (tt->rn_dupedkey)
tt->rn_dupedkey->rn_p = tt;
}
-#ifdef RN_DEBUG
- t=tt+1;
- tt->rn_info = rn_nodenum++;
- t->rn_info = rn_nodenum++;
- tt->rn_twin = t;
- tt->rn_ybro = rn_clist;
- rn_clist = tt;
-#endif
tt->rn_key = (caddr_t) v;
tt->rn_b = -1;
tt->rn_flags = RNF_ACTIVE;
@@ -851,12 +821,6 @@ on1:
*/
if (tt->rn_flags & RNF_ROOT)
return (0);
-#ifdef RN_DEBUG
- /* Get us out of the creation list */
- for (t = rn_clist; t && t->rn_ybro != tt; t = t->rn_ybro)
- ;
- if (t) t->rn_ybro = tt->rn_ybro;
-#endif
t = tt->rn_p;
dupedkey = saved_tt->rn_dupedkey;
if (dupedkey) {
@@ -879,15 +843,8 @@ on1:
}
t = tt + 1;
if (t->rn_flags & RNF_ACTIVE) {
-#ifndef RN_DEBUG
- *++x = *t;
- p = t->rn_p;
-#else
- b = t->rn_info;
*++x = *t;
- t->rn_info = b;
p = t->rn_p;
-#endif
if (p->rn_l == t)
p->rn_l = x;
else
@@ -944,13 +901,7 @@ on1:
*/
x = tt + 1;
if (t != x) {
-#ifndef RN_DEBUG
- *t = *x;
-#else
- b = t->rn_info;
*t = *x;
- t->rn_info = b;
-#endif
t->rn_l->rn_p = t;
t->rn_r->rn_p = t;
p = x->rn_p;
Index: net/radix.h
===================================================================
RCS file: /cvs/src/sys/net/radix.h,v
retrieving revision 1.23
diff -u -p -r1.23 radix.h
--- net/radix.h 19 Jan 2014 09:52:25 -0000 1.23
+++ net/radix.h 22 Jan 2014 09:59:32 -0000
@@ -60,11 +60,6 @@ struct radix_node {
struct radix_node *rn_R;/* progeny */
} rn_node;
} rn_u;
-#ifdef RN_DEBUG
- int rn_info;
- struct radix_node *rn_twin;
- struct radix_node *rn_ybro;
-#endif
};
#define rn_dupedkey rn_u.rn_leaf.rn_Dupedkey
Index: net/radix_mpath.c
===================================================================
RCS file: /cvs/src/sys/net/radix_mpath.c,v
retrieving revision 1.21
diff -u -p -r1.21 radix_mpath.c
--- net/radix_mpath.c 20 Oct 2013 16:17:36 -0000 1.21
+++ net/radix_mpath.c 22 Jan 2014 09:58:54 -0000
@@ -60,9 +60,6 @@ u_int32_t rn_mpath_hash(struct route *,
* give some jitter to hash, to avoid synchronization between routers
*/
static u_int32_t hashjitter;
-#ifdef RN_DEBUG
-extern struct radix_node *rn_clist;
-#endif
int
rn_mpath_capable(struct radix_node_head *rnh)
@@ -208,16 +205,6 @@ rn_mpath_reprio(struct radix_node *rn, i
if (rn->rn_dupedkey)
rn->rn_dupedkey->rn_p = rn;
}
-
-#ifdef RN_DEBUG
- /* readd at head of creation list */
- for (t = rn_clist; t && t->rn_ybro != rn; t = t->rn_ybro)
- ;
- if (t)
- t->rn_ybro = rn->rn_ybro;
- rn->rn_ybro = rn_clist;
- rn_clist = rn;
-#endif
if (rn->rn_mklist && rn->rn_flags & RNF_NORMAL) {
/* the rn_mklist needs to be fixed if the best route changed */