From: Alan T. DeKok Date: Wed, 8 Nov 2017 19:42:57 +0000 (-0500) Subject: check and document retransmissions X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bd8c91bdb584f67d1bc011f82cb2eec2ef8f8532;p=thirdparty%2Ffreeradius-server.git check and document retransmissions --- diff --git a/raddb/sites-available/detail b/raddb/sites-available/detail index d004c940e33..ebc18f7856c 100644 --- a/raddb/sites-available/detail +++ b/raddb/sites-available/detail @@ -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 + } } } diff --git a/src/modules/proto_detail/proto_detail_work.c b/src/modules/proto_detail/proto_detail_work.c index 6d338a3b53a..cdaa9867d5f 100644 --- a/src/modules/proto_detail/proto_detail_work.c +++ b/src/modules/proto_detail/proto_detail_work.c @@ -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; }