]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
some review comments
authorYuri Schaeffer <yuri@nlnetlabs.nl>
Fri, 22 Feb 2013 13:05:24 +0000 (13:05 +0000)
committerYuri Schaeffer <yuri@nlnetlabs.nl>
Fri, 22 Feb 2013 13:05:24 +0000 (13:05 +0000)
git-svn-id: file:///svn/unbound/branches/edns-subnet@2851 be551aaa-1e26-0410-a405-d3ace91eadb9

doc/FEATURES
doc/README
doc/unbound.conf.5.in
libunbound/libworker.c
testdata/subnet_derived.crpl
testdata/subnet_format_ip4.crpl
testdata/subnet_nondefault_opc.crpl
testdata/subnet_not_whitelisted.crpl
testdata/subnet_without_validator.crpl
util/config_file.c

index 93ed2925718cbc6479a39459912d37e3e5064aa0..66aa1c391ee5eb2051798dbc92a25ed549d1a3fd 100644 (file)
@@ -75,6 +75,8 @@ draft-ietf-dnsop-resolver-priming(-00): can prime and can fallback to
 draft-ietf-dnsop-dnssec-trust-anchor(-01): DS records can be configured 
   as trust anchors. Also DNSKEYs are allowed, by the way.
 draft-ietf-dnsext-dnssec-bis-updates: supported.
+draft-vandergaast-edns-client-subnet-01: Basic support with limited
+  caching for specific answers.
 
 Record type syntax support, extensive, from lib ldns.
 For these types only syntax and parsing support is needed.
index a5b47cf0e01240bce1e43e038b652c372985ccc8..1bf23114c69c7d5808a8e089e481f0a7b9b4c6e6 100644 (file)
@@ -77,6 +77,9 @@ This software is under BSD license, see LICENSE for details.
        Disable support for RSASHA256 and RSASHA512 crypto.
   * --disable-gost
        Disable support for GOST crypto, RFC 5933.
+  * --enable-subnet
+    Enables support for client subnet. Client address prefix is send to 
+    authorities to get a more specific answer.
 
 * 'make test' runs a series of self checks.
 
index cf04e4bd024f7535ddce40096dfa4f76fa448ee8..89c916e9680338d58c8670ddbd65afbf8a348de8 100644 (file)
@@ -904,6 +904,23 @@ it as detailed in the stub zone section below.
 Configure local data shorthand for a PTR record with the reversed IPv4 or
 IPv6 address and the host name.  For example "192.0.2.4 www.example.com".
 TTL can be inserted like this: "2001:DB8::4 7200 www.example.com"
+.TP 5
+.B send\-client\-subnet: \fI<IP address>
+Send client source address to this authority. Can be IP4 or IP6. Append 
+/num to indicate a classless delegation netblock, for example like
+10.2.3.4/24 or 2001::11/64.
+.TP 5
+.B client\-subnet\-opcode: \fI<number>
+Client subnet option code is not assigned by IANA. Specify positive
+integer smaller than 65536. Defaults to 20730.
+.TP 5
+.B max\-client\-subnet\-ipv6: \fI<number>
+Specifies the maximum prefix length of the client source address we
+are willing to expose to third parties for IPv6. Defaults to 64.
+.TP 5
+.B max\-client\-subnet\-ipv4: \fI<number>
+Specifies the maximum prefix length of the client source address we
+are willing to expose to third parties for IPv4. Defaults to 24.
 .SS "Remote Control Options"
 In the
 .B remote\-control:
index 89068a5ad6ca1f177e9e35fa2d07e7b055ef00b1..2bad0ba6056c144e34dcf089043c552dba4615ca 100644 (file)
@@ -201,23 +201,17 @@ libworker_setup(struct ub_ctx* ctx, int is_bg)
                libworker_delete(w);
                return NULL;
        }
-#ifdef CLIENT_SUBNET
        w->back = outside_network_create(w->base, cfg->msg_buffer_size,
                (size_t)cfg->outgoing_num_ports, cfg->out_ifs,
                cfg->num_out_ifs, cfg->do_ip4, cfg->do_ip6, 
                cfg->do_tcp?cfg->outgoing_num_tcp:0,
                w->env->infra_cache, w->env->rnd, cfg->use_caps_bits_for_id,
                ports, numports, cfg->unwanted_threshold,
-               &libworker_alloc_cleanup, w, cfg->do_udp, w->sslctx, NULL);
-#else
-       w->back = outside_network_create(w->base, cfg->msg_buffer_size,
-               (size_t)cfg->outgoing_num_ports, cfg->out_ifs,
-               cfg->num_out_ifs, cfg->do_ip4, cfg->do_ip6, 
-               cfg->do_tcp?cfg->outgoing_num_tcp:0,
-               w->env->infra_cache, w->env->rnd, cfg->use_caps_bits_for_id,
-               ports, numports, cfg->unwanted_threshold,
-               &libworker_alloc_cleanup, w, cfg->do_udp, w->sslctx);
+               &libworker_alloc_cleanup, w, cfg->do_udp, w->sslctx
+#ifdef CLIENT_SUBNET
+               , NULL
 #endif
+               );
        if(!w->is_bg || w->is_bg_thread) {
                lock_basic_unlock(&ctx->cfglock);
        }
@@ -751,19 +745,17 @@ struct outbound_entry* libworker_send_query(uint8_t* qname, size_t qnamelen,
        if(!e)
                return NULL;
        e->qstate = q;
- #ifdef CLIENT_SUBNET
-       e->qsent = outnet_serviced_query(w->back, qname,
-               qnamelen, qtype, qclass, flags, dnssec, want_dnssec,
-               q->env->cfg->tcp_upstream, q->env->cfg->ssl_upstream, addr,
-               addrlen, zone, zonelen, libworker_handle_service_reply, e,
-               w->back->udp_buff, &q->edns_out);
-#else
+
        e->qsent = outnet_serviced_query(w->back, qname,
                qnamelen, qtype, qclass, flags, dnssec, want_dnssec,
                q->env->cfg->tcp_upstream, q->env->cfg->ssl_upstream, addr,
                addrlen, zone, zonelen, libworker_handle_service_reply, e,
-               w->back->udp_buff);
+               w->back->udp_buff
+#ifdef CLIENT_SUBNET
+               , &q->edns_out
 #endif
+               );
+
        if(!e->qsent) {
                return NULL;
        }
index 2493d4b62f9e4ba9cbedfb70a121692b19d3cfb0..3cca47a14333fa3cffc0a1b882421c219f9e84e6 100644 (file)
@@ -1,7 +1,7 @@
 server:
        send-client-subnet: 5.0.15.10
        send-client-subnet: 193.0.14.129 
-       client-subnet-opc: 20730
+       client-subnet-opcode: 20730
        max-client-subnet-ipv4: 21
        verbosity: 3
        module-config: "subnetcache validator iterator"
index ced6888afc260952ac8243c67fb8703daf12b09b..817772a21995b75a1d748bd4d5f78e876ee73209 100644 (file)
@@ -1,6 +1,6 @@
 server:
        send-client-subnet: 5.0.15.10
-       client-subnet-opc: 20730
+       client-subnet-opcode: 20730
        max-client-subnet-ipv4: 21
        verbosity: 3
        module-config: "subnetcache validator iterator"
index 9e309d2425926487f0e9e20ad83e2c0af22a3e69..9363e35a401ab00e3249e31ce7fc6b1bf2ded6df 100644 (file)
@@ -1,6 +1,6 @@
 server:
        send-client-subnet: 5.0.15.10
-       client-subnet-opc: 99
+       client-subnet-opcode: 99
        max-client-subnet-ipv4: 21
        verbosity: 3
        module-config: "subnetcache validator iterator"
index 58df0132f9b8ef3971b56bd12b0b8fea64e1ddb8..9cf1f475993745672f634568d72347d64b0fb00d 100644 (file)
@@ -1,6 +1,6 @@
 server:
 ;      send-client-subnet: 5.0.15.10
-       client-subnet-opc: 20730
+       client-subnet-opcode: 20730
        max-client-subnet-ipv4: 21
        verbosity: 3
        module-config: "subnetcache validator iterator"
index 0cc6ad091507e82a8c1105771ad075c0c0624c7e..0d73ce835c1dd26835de57ab97e6d372b32278e0 100644 (file)
@@ -1,6 +1,6 @@
 server:
        send-client-subnet: 5.0.15.10
-       client-subnet-opc: 20730
+       client-subnet-opcode: 20730
        max-client-subnet-ipv4: 21
        verbosity: 3
        module-config: "subnetcache iterator"
index 30eac6c7abdbeb0f59fa2632c52cb4393d99c3cc..6a2894204933f444a7099ae7644b5cef4dfc4c77 100644 (file)
@@ -436,7 +436,7 @@ int config_set_option(struct config_file* cfg, const char* opt,
        else S_STRLIST("send-client-subnet", client_subnet)
        else S_NUMBER_OR_ZERO("max-client-subnet-ipv4:", max_client_subnet_ipv4)
        else S_NUMBER_OR_ZERO("max-client-subnet-ipv6:", max_client_subnet_ipv6)
-       else S_NUMBER_OR_ZERO("client-subnet-opc:", client_subnet_opcode)
+       else S_NUMBER_OR_ZERO("client-subnet-opcode:", client_subnet_opcode)
 #endif
        else if (strcmp(opt, "outgoing-interface:") == 0) {
                char* d = strdup(val);
@@ -686,7 +686,7 @@ config_get_option(struct config_file* cfg, const char* opt,
        else O_LST(opt, "send-client-subnet", client_subnet)
        else O_DEC(opt, "max-client-subnet-ipv4", max_client_subnet_ipv4)
        else O_DEC(opt, "max-client-subnet-ipv6", max_client_subnet_ipv6)
-       else O_DEC(opt, "client-subnet-opc", client_subnet_opcode)
+       else O_DEC(opt, "client-subnet-opcode", client_subnet_opcode)
 #endif
        /* not here:
         * outgoing-permit, outgoing-avoid - have list of ports