From d9439a0eeeed8b1902aa3000796abf7c9c078b0a 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 e0e4ca22a..035913e9b 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); } }