e->ixfr_soa_serial = (uint32_t)strtol(parse, (char**)&parse, 10);
while(isspace((int)*parse))
parse++;
+ } else if(str_keyword(&parse, "udp_size")) {
+ if(*parse != '=' && *parse != ':')
+ error("expected = or : in MATCH: %s", line);
+ parse++;
+ e->match_udp_size = (uint32_t)strtol(parse, (char**)&parse, 10);
+ while(isspace((int)*parse))
+ parse++;
} else {
error("could not parse MATCH: '%s'", parse);
}
e->match_serial = false;
e->ixfr_soa_serial = 0;
e->match_transport = transport_any;
+ e->match_udp_size = 0;
e->reply_list = NULL;
e->copy_id = false;
e->copy_query = false;
verbose(3, "bad transport\n");
continue;
}
+ if(p->match_udp_size > 0 && transport == transport_udp && (
+ !ldns_pkt_edns(query_pkt) ||
+ ldns_pkt_edns_udp_size(query_pkt) < p->match_udp_size)) {
+ verbose(3, "bad udp_size\n");
+ continue;
+ }
if(p->match_all && !match_all(query_pkt, reply, p->match_ttl)) {
verbose(3, "bad allmatch\n");
continue;
; 'DO' will match only queries with DO bit set.
; 'noedns' matches queries without EDNS OPT records.
; 'ednsdata' matches queries to HEX_EDNS section.
+ ; 'udp_size=1232' makes the query match if:
+ ; udp_size in query edns0 field >= 1232,
+ ; or the query came over TCP.
MATCH [opcode] [qtype] [qname] [serial=<value>] [all] [ttl]
MATCH [UDP|TCP] DO
MATCH ...
uint32_t ixfr_soa_serial;
/** match on UDP/TCP */
enum transport_type match_transport;
+ /** match on edns udp size (larger or equal) */
+ uint16_t match_udp_size;
/** pre canned reply */
struct reply_packet *reply_list;