]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Remove un-used ippool_pool_name()
authorNick Porter <nick@portercomputing.co.uk>
Thu, 8 Jun 2023 09:02:06 +0000 (10:02 +0100)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Thu, 8 Jun 2023 18:57:03 +0000 (14:57 -0400)
src/modules/rlm_redis_ippool/rlm_redis_ippool.c

index 5f7170cfaa8945dce1e94d42af88f90d171c55c5..47d1da30d88b0c896008e93b4b38a0b0b3ff7034 100644 (file)
@@ -1074,45 +1074,6 @@ finish:
        return ret;
 }
 
-/** Find the pool name we'll be allocating from
- *
- * @param[out] out     Where to write the pool name.
- * @param[out] buff    Where to write the pool name (in the case of an expansion).
- * @param[in] bufflen  Size of the output buffer.
- * @param[in] inst     This instance of the rlm_redis_ippool module.
- * @param[in] request  The current request.
- * @return
- *     - < 0 on error.
- *     - 0 if no pool attribute exists, or the pool name is a zero length string.
- *     - > 0 on success (length of data written to out).
- */
-static inline ssize_t ippool_pool_name(uint8_t const **out, uint8_t buff[], size_t bufflen,
-                                      rlm_redis_ippool_t const *inst, request_t *request)
-{
-       ssize_t slen;
-
-       slen = tmpl_expand(out, (char *)buff, bufflen, request, inst->pool_name, NULL, NULL);
-       if (slen < 0) {
-               if (tmpl_is_attr(inst->pool_name)) {
-                       RDEBUG2("Pool attribute not present in request.  Doing nothing");
-                       return 0;
-               }
-               REDEBUG("Failed expanding pool name");
-               return -1;
-       }
-       if (slen == 0) {
-               RDEBUG2("Empty pool name.  Doing nothing");
-               return 0;
-       }
-
-       if ((*out == buff) && is_truncated((size_t)slen, bufflen)) {
-               REDEBUG("Pool name too long.  Expected %zu bytes, got %zu bytes", bufflen, (size_t)slen);
-               return -1;
-       }
-
-       return slen;
-}
-
 static unlang_action_t mod_action(rlm_rcode_t *p_result, module_ctx_t const *mctx, request_t *request,
                                  ippool_action_t action)
 {