From 8e28bf29365c21e79ca0fe198f90d9d57b0162b6 Mon Sep 17 00:00:00 2001 From: Jilles Tjoelker Date: Sat, 20 Sep 2008 00:30:35 +0200 Subject: [PATCH] ip_cloaking: clarify logic This also slightly changes mangled IPs but the mangling is on the same level. --- extensions/ip_cloaking.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/extensions/ip_cloaking.c b/extensions/ip_cloaking.c index e0e4ca2..035913e 100644 --- a/extensions/ip_cloaking.c +++ b/extensions/ip_cloaking.c @@ -106,19 +106,13 @@ do_host_cloak_ip(const char *inbuf, char *outbuf) continue; } - switch (ipv6) - { - case 1: - if (sepcount < totalcount / 2) - break; - case 0: - if (sepcount < 2) - break; - default: - *tptr = chartable[(*tptr + accum) % 20]; + if (ipv6 && sepcount < totalcount / 2) + continue; - } + if (!ipv6 && sepcount < 2) + continue; + *tptr = chartable[(*tptr + accum) % 20]; accum = (accum << 1) | (accum >> 31); } }