]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Fix low-rtt-pct to low-rtt-permil, as it is parts in one thousand.
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Tue, 15 May 2018 07:30:53 +0000 (07:30 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Tue, 15 May 2018 07:30:53 +0000 (07:30 +0000)
git-svn-id: file:///svn/unbound/trunk@4683 be551aaa-1e26-0410-a405-d3ace91eadb9

doc/Changelog
doc/example.conf.in
doc/unbound.conf.5.in
iterator/iter_utils.c
util/config_file.c
util/config_file.h
util/configlexer.lex
util/configparser.y

index 512153061ba1ddd589c032b333e3a11f4ce86518..72cf0b9eeebf97240b5adf13a95cf299c773527b 100644 (file)
@@ -1,3 +1,6 @@
+15 May 2018: Wouter
+       - Fix low-rtt-pct to low-rtt-permil, as it is parts in one thousand.
+
 11 May 2018: Wouter
        - Fix contrib/libunbound.pc for libssl libcrypto references,
          from https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=226914
index 160a45d286cb6be3b064b5d153a0b2db870a3c9a..32b6026a58b8fbed11f5ceed3f685ffd89ebcacf 100644 (file)
@@ -725,7 +725,7 @@ server:
        # low-rtt: 45
        # select low rtt this many times out of 1000. 0 means the fast server
        # select is disabled.  prefetches are not sped up.
-       # low-rtt-pct: 0
+       # low-rtt-permil: 0
 
        # Specific options for ipsecmod. unbound needs to be configured with
        # --enable-ipsecmod for these to take effect.
index 57dceeb863ced0b604303f5ab4a3badc3aceb826..7a5e9fbce488ad45859046bcd8856555ee830289 100644 (file)
@@ -1315,10 +1315,10 @@ factor given.
 .TP 5
 .B low\-rtt: \fI<msec time>
 Set the time in millisecond that is considere a low ping time for fast
-server selection with the low\-rtt\-pct option, that turns this on or off.
+server selection with the low\-rtt\-permil option, that turns this on or off.
 The default is 45 msec, a number from IPv6 quick response documents.
 .TP 5
-.B low\-rtt\-pct: \fI<number>
+.B low\-rtt\-permil: \fI<number>
 Specify how many times out of 1000 to pick the fast server from the low
 rtt band.  0 turns the feature off.  A value of 900 would pick the fast
 server when such fast servers are available 90 percent of the time, and
@@ -1328,7 +1328,7 @@ sped up, because there is no one waiting for it, and it presents a good
 moment to perform server exploration.  The low\-rtt option can be used
 to specify which servers are picked for fast server selection, servers
 with a ping roundtrip time below that value are considered.
-The default for low\-rtt\-pct is 0.
+The default for low\-rtt\-permil is 0.
 .SS "Remote Control Options"
 In the
 .B remote\-control:
index 752474cd8e6f0ef7371a569372ed9efb20ef19d8..0a8f7700fcf0fb00b8a5b986522dc2e52a129cf0 100644 (file)
@@ -329,9 +329,9 @@ iter_filter_order(struct iter_env* iter_env, struct module_env* env,
                             return 0 to force the caller to fetch more */
        }
 
-       if(env->cfg->low_rtt_pct != 0 && prefetch == 0 &&
+       if(env->cfg->low_rtt_permil != 0 && prefetch == 0 &&
                low_rtt < env->cfg->low_rtt &&
-               ub_random_max(env->rnd, 1000) < env->cfg->low_rtt_pct) {
+               ub_random_max(env->rnd, 1000) < env->cfg->low_rtt_permil) {
                /* the query is not prefetch, but for a downstream client,
                 * there is a low_rtt (fast) server.  We choose that x% of the
                 * time */
index 3bf5f6308715e74eadcba132962bec0c9d486317..70dc09304d689c5504214d83a986a8935fd1d340 100644 (file)
@@ -161,7 +161,7 @@ config_create(void)
        if(!(cfg->logfile = strdup(""))) goto error_exit;
        if(!(cfg->pidfile = strdup(PIDFILE))) goto error_exit;
        if(!(cfg->target_fetch_policy = strdup("3 2 1 0 0"))) goto error_exit;
-       cfg->low_rtt_pct = 0;
+       cfg->low_rtt_permil = 0;
        cfg->low_rtt = 45;
        cfg->donotqueryaddrs = NULL;
        cfg->donotquery_localhost = 1;
@@ -618,7 +618,8 @@ int config_set_option(struct config_file* cfg, const char* opt,
        else S_NUMBER_OR_ZERO("ip-ratelimit-factor:", ip_ratelimit_factor)
        else S_NUMBER_OR_ZERO("ratelimit-factor:", ratelimit_factor)
        else S_NUMBER_OR_ZERO("low-rtt:", low_rtt)
-       else S_NUMBER_OR_ZERO("low-rtt-pct:", low_rtt_pct)
+       else S_NUMBER_OR_ZERO("low-rtt-pct:", low_rtt_permil)
+       else S_NUMBER_OR_ZERO("low-rtt-permil:", low_rtt_permil)
        else S_YNO("qname-minimisation:", qname_minimisation)
        else S_YNO("qname-minimisation-strict:", qname_minimisation_strict)
 #ifdef USE_IPSECMOD
@@ -1001,7 +1002,8 @@ config_get_option(struct config_file* cfg, const char* opt,
        else O_DEC(opt, "ip-ratelimit-factor", ip_ratelimit_factor)
        else O_DEC(opt, "ratelimit-factor", ratelimit_factor)
        else O_DEC(opt, "low-rtt", low_rtt)
-       else O_DEC(opt, "low-rtt-pct", low_rtt_pct)
+       else O_DEC(opt, "low-rtt-pct", low_rtt_permil)
+       else O_DEC(opt, "low-rtt-permil", low_rtt_permil)
        else O_DEC(opt, "val-sig-skew-min", val_sig_skew_min)
        else O_DEC(opt, "val-sig-skew-max", val_sig_skew_max)
        else O_YNO(opt, "qname-minimisation", qname_minimisation)
index eba60b9a1356c6a06aef62995fadf8b6d31c0139..2b49d9c6ef5288f19285aabeb5302cb27a3b9f07 100644 (file)
@@ -144,7 +144,7 @@ struct config_file {
        /** the target fetch policy for the iterator */
        char* target_fetch_policy;
        /** percent*10, how many times in 1000 to pick low rtt destinations */
-       int low_rtt_pct;
+       int low_rtt_permil;
        /** what time in msec is a low rtt destination */
        int low_rtt;
 
index 73dfe4bd4f2946adc20ef9c548001976df7eeab1..00fde10aaca8a05974dc3826170aaa9bdc7c29a1 100644 (file)
@@ -428,7 +428,8 @@ ratelimit-below-domain{COLON}       { YDVAR(2, VAR_RATELIMIT_BELOW_DOMAIN) }
 ip-ratelimit-factor{COLON}             { YDVAR(1, VAR_IP_RATELIMIT_FACTOR) }
 ratelimit-factor{COLON}                { YDVAR(1, VAR_RATELIMIT_FACTOR) }
 low-rtt{COLON}                 { YDVAR(1, VAR_LOW_RTT) }
-low-rtt-pct{COLON}             { YDVAR(1, VAR_LOW_RTT_PCT) }
+low-rtt-pct{COLON}             { YDVAR(1, VAR_LOW_RTT_PERMIL) }
+low-rtt-permil{COLON}          { YDVAR(1, VAR_LOW_RTT_PERMIL) }
 response-ip-tag{COLON}         { YDVAR(2, VAR_RESPONSE_IP_TAG) }
 response-ip{COLON}             { YDVAR(2, VAR_RESPONSE_IP) }
 response-ip-data{COLON}                { YDVAR(2, VAR_RESPONSE_IP_DATA) }
index a71bf914c762261458bf45e68d4936c515c884dc..a8f8027fe1bb346d3ce0633e14a60901c694b0a5 100644 (file)
@@ -156,7 +156,7 @@ extern struct config_parser_state* cfg_parser;
 %token VAR_CACHEDB_REDISHOST VAR_CACHEDB_REDISPORT VAR_CACHEDB_REDISTIMEOUT
 %token VAR_UDP_UPSTREAM_WITHOUT_DOWNSTREAM VAR_FOR_UPSTREAM
 %token VAR_AUTH_ZONE VAR_ZONEFILE VAR_MASTER VAR_URL VAR_FOR_DOWNSTREAM
-%token VAR_FALLBACK_ENABLED VAR_ADDITIONAL_TLS_PORT VAR_LOW_RTT VAR_LOW_RTT_PCT
+%token VAR_FALLBACK_ENABLED VAR_ADDITIONAL_TLS_PORT VAR_LOW_RTT VAR_LOW_RTT_PERMIL
 %token VAR_ALLOW_NOTIFY
 
 %%
@@ -249,7 +249,7 @@ content_server: server_num_threads | server_verbosity | server_port |
        server_ipsecmod_whitelist | server_ipsecmod_strict |
        server_udp_upstream_without_downstream | server_aggressive_nsec |
        server_tls_cert_bundle | server_additional_tls_port | server_low_rtt |
-       server_low_rtt_pct
+       server_low_rtt_permil
        ;
 stubstart: VAR_STUB_ZONE
        {
@@ -1885,12 +1885,12 @@ server_low_rtt: VAR_LOW_RTT STRING_ARG
                free($2);
        }
        ;
-server_low_rtt_pct: VAR_LOW_RTT_PCT STRING_ARG 
+server_low_rtt_permil: VAR_LOW_RTT_PERMIL STRING_ARG 
        { 
-               OUTYY(("P(server_low_rtt_pct:%s)\n", $2)); 
+               OUTYY(("P(server_low_rtt_permil:%s)\n", $2)); 
                if(atoi($2) == 0 && strcmp($2, "0") != 0)
                        yyerror("number expected");
-               else cfg_parser->cfg->low_rtt_pct = atoi($2);
+               else cfg_parser->cfg->low_rtt_permil = atoi($2);
                free($2);
        }
        ;