]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Fix issue with delete command that caused entries to remain if the address had never...
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Wed, 24 Mar 2021 19:39:48 +0000 (19:39 +0000)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Wed, 24 Mar 2021 19:39:48 +0000 (19:39 +0000)
src/modules/rlm_redis_ippool/rlm_redis_ippool_tool.c

index 772e7c0d075a44b0f6a9725805356032cc74d555..c0fdd66c36e0fa48604c87f3a169d2b30cb1d638 100644 (file)
@@ -186,10 +186,10 @@ static char lua_remove_cmd[] =
        "ret = redis.call('ZREM', '{' .. KEYS[1] .. '}:"IPPOOL_POOL_KEY"', ARGV[1])" EOL        /* 4 */
        "address_key = '{' .. KEYS[1] .. '}:"IPPOOL_ADDRESS_KEY":' .. ARGV[1]" EOL      /* 5 */
        "found = redis.call('HGET', address_key, 'device')" EOL                         /* 6 */
-       "if not found then" EOL                                                         /* 7 */
-       "  return ret"  EOL                                                             /* 8 */
-       "end" EOL                                                                       /* 9 */
-       "redis.call('DEL', address_key)" EOL                                            /* 10 */
+       "redis.call('DEL', address_key)" EOL                                            /* 7 */
+       "if not found then" EOL                                                         /* 8 */
+       "  return ret"  EOL                                                             /* 9 */
+       "end" EOL                                                                       /* 10 */
 
        /*
         *      Remove the association between the device and a lease