]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
check and document retransmissions
authorAlan T. DeKok <aland@freeradius.org>
Wed, 8 Nov 2017 19:42:57 +0000 (14:42 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Wed, 8 Nov 2017 19:44:01 +0000 (14:44 -0500)
raddb/sites-available/detail
src/modules/proto_detail/proto_detail_work.c

index d004c940e33b545407422330942619748247251c..ebc18f7856c6c23a778349b03de2029f48f82995 100644 (file)
@@ -137,6 +137,60 @@ virtual_server detail {
                        #  is done from the file.
                        #
                        max_entry_size = 65536
+
+                       #
+                       #  Whether or not the module retransmits
+                       #  packets which have failed.
+                       #
+                       #  default = yes
+                       #
+                       retransmit = yes
+
+                       #
+                       #  Limits for retransmissions.
+                       #
+                       limit {
+                               #
+                               #  Initial retransmit time: 1..60
+                               #
+                               #  If there is no response within this time,
+                               #  the module will retransmit the packet.
+                               #
+                               initial_retransmission_time = 1
+
+                               #
+                               #  Maximum Retransmit Time: 5..30
+                               #
+                               #  The maximum time between retransmissions.
+                               #
+                               maximum_retransmission_time = 30
+
+                               #
+                               #  The following are maximums that *all* apply.
+                               #  i.e. if any one of the limits is hit, the
+                               #  retransmission stops.
+                               #
+
+                               #
+                               #  Maximum Retransmit Count: 1..20
+                               #
+                               #  How many times the module will send the packet
+                               #  before giving up.
+                               #
+                               #  A special value of "0" means "retransmit forever".
+                               #
+                               maximum_retransmission_count = 6
+
+                               #
+                               #  Maximum Retransmit Duration: 1..600
+                               #
+                               #  The total length of time the module will try to
+                               #  retransit the packet
+                               #
+                               #  A special value of "0" means "retransmit forever".
+                               #
+                               maximum_retransmission_duration = 40
+                       }
                }
        }
 
index 6d338a3b53a76342d303f30842d3f5fe9b32e7a5..cdaa9867d5fe1f2e09e423029dcb26dbdd0d05ad 100644 (file)
@@ -491,7 +491,7 @@ static ssize_t mod_write(void *instance, void *packet_ctx,
                        goto fail;
                }
 
-               when.tv_sec = 1;
+               when.tv_sec = inst->irt;
                when.tv_usec = 0;
 
                DEBUG("%s - packet %d failed during processing.  Will retransmit in %d.%06ds",
@@ -713,6 +713,23 @@ static int mod_bootstrap(void *instance, CONF_SECTION *cs)
                inst->mode = O_RDONLY;
        }
 
+       if (inst->retransmit) {
+               FR_INTEGER_BOUND_CHECK("limit.initial_retransmission_time", inst->irt, >=, 1);
+               FR_INTEGER_BOUND_CHECK("limit.initial_retransmission_time", inst->irt, <=, 60);
+
+               /*
+                *      If you need more than this, just set it to
+                *      "0", and check Packet-Transmit-Count manually.
+                */
+               FR_INTEGER_BOUND_CHECK("limit.maximum_retransmission_count", inst->mrc, <=, 20);
+               FR_INTEGER_BOUND_CHECK("limit.maximum_retransmission_duration", inst->mrd, <=, 600);
+
+               /*
+                *      This is a reasonable value.
+                */
+               FR_INTEGER_BOUND_CHECK("limit.maximum_retransmission_timer", inst->mrt, <=, 30);
+       }
+
        return 0;
 }