]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Ensure limits are checked regardless of restricted source port range
authorNick Porter <nick@portercomputing.co.uk>
Fri, 8 Aug 2025 08:08:15 +0000 (09:08 +0100)
committerNick Porter <nick@portercomputing.co.uk>
Fri, 8 Aug 2025 08:08:15 +0000 (09:08 +0100)
src/modules/rlm_radius/rlm_radius.c

index 4f0039bdb94038c9b67a8e28ca74baceb4a0531a..ad8321a4619b8770c7c468ff5422e109915e526d 100644 (file)
@@ -766,6 +766,19 @@ check_others:
                        return -1;
                }
 
+               /*
+                *      Encorce limits per trunk, due to the 8-bit ID space.
+                */
+               FR_INTEGER_BOUND_CHECK("trunk.per_connection_max", inst->trunk_conf.max_req_per_conn, >=, 2);
+               FR_INTEGER_BOUND_CHECK("trunk.per_connection_max", inst->trunk_conf.max_req_per_conn, <=, 255);
+               FR_INTEGER_BOUND_CHECK("trunk.per_connection_target", inst->trunk_conf.target_req_per_conn, <=, inst->trunk_conf.max_req_per_conn / 2);
+
+               /*
+                *      This only applies for XLAT_PROXY, but what the heck.
+                */
+               FR_TIME_DELTA_BOUND_CHECK("home_server_lifetime", inst->home_server_lifetime, >=, fr_time_delta_from_sec(10));
+               FR_TIME_DELTA_BOUND_CHECK("home_server_lifetime", inst->home_server_lifetime, <=, fr_time_delta_from_sec(3600));
+
                /*
                 *      No src_port range, we don't need to check any other settings.
                 */
@@ -795,18 +808,6 @@ check_others:
                        return -1;
                }
 
-               /*
-                *      Encorce limits per trunk, due to the 8-bit ID space.
-                */
-               FR_INTEGER_BOUND_CHECK("trunk.per_connection_max", inst->trunk_conf.max_req_per_conn, >=, 2);
-               FR_INTEGER_BOUND_CHECK("trunk.per_connection_max", inst->trunk_conf.max_req_per_conn, <=, 255);
-               FR_INTEGER_BOUND_CHECK("trunk.per_connection_target", inst->trunk_conf.target_req_per_conn, <=, inst->trunk_conf.max_req_per_conn / 2);
-
-               /*
-                *      This only applies for XLAT_PROXY, but what the heck.
-                */
-               FR_TIME_DELTA_BOUND_CHECK("home_server_lifetime", inst->home_server_lifetime, >=, fr_time_delta_from_sec(10));
-               FR_TIME_DELTA_BOUND_CHECK("home_server_lifetime", inst->home_server_lifetime, <=, fr_time_delta_from_sec(3600));
                break;
 
        case RLM_RADIUS_MODE_UNCONNECTED_REPLICATE: