]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
modules/block: block ANY type example
authorMarek Vavruša <marek.vavrusa@nic.cz>
Mon, 22 Jun 2015 11:23:43 +0000 (13:23 +0200)
committerMarek Vavruša <marek.vavrusa@nic.cz>
Mon, 22 Jun 2015 11:23:43 +0000 (13:23 +0200)
daemon/bindings/kres.c
modules/block/README.rst

index f77a304e38854718400dd554151ce19e87239370..5c4a5911ad4a36cfe92a1e1170fa4f4fa3f799eb 100644 (file)
@@ -60,7 +60,7 @@ static inline void lua_pushdname(lua_State *L, const knot_dname_t *name)
        X(SSHFP) X(IPSECKEY) X(RRSIG) X(NSEC) X(DNSKEY) X(DHCID) \
        X(NSEC3) X(NSEC3PARAM) X(TLSA) X(CDS) X(CDNSKEY) X(SPF) \
        X(NID) X(L32) X(L64) X(LP) X(EUI48) X(EUI64) X(TKEY) \
-       X(TSIG) X(IXFR) X(AXFR)
+       X(TSIG) X(IXFR) X(AXFR) X(ANY)
 
 static lookup_table_t rrtype_names[] = {
        #define X(rc) { KNOT_RRTYPE_ ## rc, #rc },
@@ -306,4 +306,4 @@ int lib_kres(lua_State *L)
        /* Register metatables */
        pkt_meta_register(L);
        return 1;       
-}
\ No newline at end of file
+}
index 6991431fad81adc08fed74f066e4ce6b7a4aa9ec..2d2536c915c4622e562b38fdb7a785c92abad65c 100644 (file)
@@ -38,6 +38,12 @@ Example configuration
                        return block.DENY, '224.in-addr.arpa.'
                end
        end)
+       -- Disallow ANY queries
+       block:add(function (pkt, qname)
+               if pkt:qtype() == kres.rrtype.ANY then
+                       return block.DROP
+               end
+       end)
 
 Properties
 ^^^^^^^^^^