summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorclaudio <claudio@openbsd.org>2008-12-29 21:24:19 +0000
committerclaudio <claudio@openbsd.org>2008-12-29 21:24:19 +0000
commit9c36c3b2c02f73dee8ba3faa19c3674c7384b0a0 (patch)
treec5f29ed5170d7ab90611c4c6e10a0f830a5e407f
parentUse rn_mpath_next() in rtalloc_mpath() to figure out if the next route (diff)
downloadwireguard-openbsd-9c36c3b2c02f73dee8ba3faa19c3674c7384b0a0.tar.xz
wireguard-openbsd-9c36c3b2c02f73dee8ba3faa19c3674c7384b0a0.zip
At least try to make this code a bit easier to read. Don't fiddle with x
when xx can do the trick or in dlg's words: "xx was a copy of x so they could use x for some temp working and restore it from xx later? yeesh" ok dlg@
-rw-r--r--sys/net/radix.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/sys/net/radix.c b/sys/net/radix.c
index 3da7a554702..cd704b9b0a3 100644
--- a/sys/net/radix.c
+++ b/sys/net/radix.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: radix.c,v 1.24 2008/11/21 18:01:30 claudio Exp $ */
+/* $OpenBSD: radix.c,v 1.25 2008/12/29 21:24:19 claudio Exp $ */
/* $NetBSD: radix.c,v 1.20 2003/08/07 16:32:56 agc Exp $ */
/*
@@ -597,18 +597,17 @@ rn_addroute(void *v_arg, void *n_arg, struct radix_node_head *head,
* parent pointer.
*/
if (tt == saved_tt && prioinv) {
- struct radix_node *xx = x;
+ struct radix_node *xx;
/* link in at head of list */
(tt = treenodes)->rn_dupedkey = t;
tt->rn_flags = t->rn_flags;
- tt->rn_p = x = t->rn_p;
+ tt->rn_p = xx = t->rn_p;
t->rn_p = tt;
- if (x->rn_l == t)
- x->rn_l = tt;
+ if (xx->rn_l == t)
+ xx->rn_l = tt;
else
- x->rn_r = tt;
+ xx->rn_r = tt;
saved_tt = tt;
- x = xx;
} else if (prioinv == 1) {
(tt = treenodes)->rn_dupedkey = t;
if (t->rn_p == NULL)