From: Alan T. DeKok Date: Fri, 5 Jan 2018 15:26:37 +0000 (-0500) Subject: ignore old clients if their prefix is too small X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=636d2236c55d63a3bc391c13f53172eeee610f07;p=thirdparty%2Ffreeradius-server.git ignore old clients if their prefix is too small fr_trie_lookup() returns the longest prefix match. Which still might be smaller than the prefix of the client we're trying to add. --- diff --git a/src/main/client.c b/src/main/client.c index d3a98961213..3893fc81439 100644 --- a/src/main/client.c +++ b/src/main/client.c @@ -203,7 +203,7 @@ bool client_add(RADCLIENT_LIST *clients, RADCLIENT *client) * Cannot insert the same client twice. */ old = fr_trie_lookup(trie, &client->ipaddr.addr, client->ipaddr.prefix); - if (old) { + if (old && (old->ipaddr.prefix >= client->ipaddr.prefix)) { /* * If it's a complete duplicate, then free the new * one, and return "OK".