From 18732ba952c576c890e2fa79f9e164ae51dd320a Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 31 Jan 2007 14:05:09 +0000 Subject: r21086: add some notes metze (This used to be commit dfbdb958419a041c1aff039810f7e9cb4320ec2c) --- source4/nbt_server/wins/winsserver.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'source4') diff --git a/source4/nbt_server/wins/winsserver.c b/source4/nbt_server/wins/winsserver.c index 6b91f78ad0..072c646a92 100644 --- a/source4/nbt_server/wins/winsserver.c +++ b/source4/nbt_server/wins/winsserver.c @@ -642,6 +642,13 @@ static void nbtd_wins_randomize1Clist(const char **addresses, struct socket_addr /* * if we haven't found an address in the same subnet, search in ones * which match the client more + * + * some notes: + * + * it's not "idx = idx % r" but "idx = r % idx" + * because in "a % b" b is the allowed range + * and b-1 is the maximum possible result, so it must be decreasing + * and the above idx == 0 check breaks the while(1) loop. */ idx = r % idx; } -- cgit