mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-28 21:17:54 +00:00
3895. [func] Add the ability to set the DSCP code point to dig.
[RT #36546]
This commit is contained in:
parent
71ec6d0940
commit
2064e46209
3
CHANGES
3
CHANGES
@ -1,3 +1,6 @@
|
|||||||
|
3895. [func] Add the ability to set the DSCP code point to dig.
|
||||||
|
[RT #36546]
|
||||||
|
|
||||||
3894. [bug] Buffers in isc_print_vsnprintf were not properly
|
3894. [bug] Buffers in isc_print_vsnprintf were not properly
|
||||||
initialized leading to potential overflows when
|
initialized leading to potential overflows when
|
||||||
printing out quad values. [RT #36505]
|
printing out quad values. [RT #36505]
|
||||||
|
@ -243,6 +243,7 @@ help(void) {
|
|||||||
" +[no]multiline (Print records in an expanded format)\n"
|
" +[no]multiline (Print records in an expanded format)\n"
|
||||||
" +[no]onesoa (AXFR prints only one soa record)\n"
|
" +[no]onesoa (AXFR prints only one soa record)\n"
|
||||||
" +[no]keepopen (Keep the TCP socket open between queries)\n"
|
" +[no]keepopen (Keep the TCP socket open between queries)\n"
|
||||||
|
" +[no]dscp[=###] (Set the DSCP value to ### [0..63])\n"
|
||||||
" global d-opts and servers (before host name) affect all queries.\n"
|
" global d-opts and servers (before host name) affect all queries.\n"
|
||||||
" local d-opts and servers (after host name) affect only that lookup.\n"
|
" local d-opts and servers (after host name) affect only that lookup.\n"
|
||||||
" -h (print help and exit)\n"
|
" -h (print help and exit)\n"
|
||||||
@ -920,6 +921,19 @@ plus_option(char *option, isc_boolean_t is_batchfile,
|
|||||||
strncpy(domainopt, value, sizeof(domainopt));
|
strncpy(domainopt, value, sizeof(domainopt));
|
||||||
domainopt[sizeof(domainopt)-1] = '\0';
|
domainopt[sizeof(domainopt)-1] = '\0';
|
||||||
break;
|
break;
|
||||||
|
case 's': /* dscp */
|
||||||
|
FULLCHECK("dscp");
|
||||||
|
if (!state) {
|
||||||
|
lookup->dscp = -1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (value == NULL)
|
||||||
|
goto need_value;
|
||||||
|
result = parse_uint(&num, value, 0x3f, "DSCP");
|
||||||
|
if (result != ISC_R_SUCCESS)
|
||||||
|
fatal("Couldn't parse DSCP value");
|
||||||
|
lookup->dscp = num;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
goto invalid_option;
|
goto invalid_option;
|
||||||
}
|
}
|
||||||
|
@ -555,6 +555,16 @@
|
|||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry>
|
||||||
|
<term><option>+dscp=value</option></term> <listitem>
|
||||||
|
<para>
|
||||||
|
Set the DSCP code point to be used when sending the
|
||||||
|
query. Valid DSCP code points are in the range
|
||||||
|
[0..63]. By default no code point is explictly set.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term><option>+[no]edns[=#]</option></term>
|
<term><option>+[no]edns[=#]</option></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
|
@ -813,6 +813,7 @@ make_empty_lookup(void) {
|
|||||||
#endif
|
#endif
|
||||||
looknew->ednsopts = NULL;
|
looknew->ednsopts = NULL;
|
||||||
looknew->ednsoptscnt = 0;
|
looknew->ednsoptscnt = 0;
|
||||||
|
looknew->dscp = -1;
|
||||||
dns_fixedname_init(&looknew->fdomain);
|
dns_fixedname_init(&looknew->fdomain);
|
||||||
ISC_LINK_INIT(looknew, link);
|
ISC_LINK_INIT(looknew, link);
|
||||||
ISC_LIST_INIT(looknew->q);
|
ISC_LIST_INIT(looknew->q);
|
||||||
@ -898,6 +899,7 @@ clone_lookup(dig_lookup_t *lookold, isc_boolean_t servers) {
|
|||||||
looknew->tsigctx = NULL;
|
looknew->tsigctx = NULL;
|
||||||
looknew->need_search = lookold->need_search;
|
looknew->need_search = lookold->need_search;
|
||||||
looknew->done_as_is = lookold->done_as_is;
|
looknew->done_as_is = lookold->done_as_is;
|
||||||
|
looknew->dscp = lookold->dscp;
|
||||||
|
|
||||||
if (lookold->ecs_addr != NULL) {
|
if (lookold->ecs_addr != NULL) {
|
||||||
size_t len = sizeof(isc_sockaddr_t);
|
size_t len = sizeof(isc_sockaddr_t);
|
||||||
@ -2781,6 +2783,8 @@ send_tcp_connect(dig_query_t *query) {
|
|||||||
check_result(result, "isc_socket_create");
|
check_result(result, "isc_socket_create");
|
||||||
sockcount++;
|
sockcount++;
|
||||||
debug("sockcount=%d", sockcount);
|
debug("sockcount=%d", sockcount);
|
||||||
|
if (query->lookup->dscp != -1)
|
||||||
|
isc_socket_dscp(query->sock, query->lookup->dscp);
|
||||||
if (specified_source)
|
if (specified_source)
|
||||||
result = isc_socket_bind(query->sock, &bind_address,
|
result = isc_socket_bind(query->sock, &bind_address,
|
||||||
ISC_SOCKET_REUSEADDRESS);
|
ISC_SOCKET_REUSEADDRESS);
|
||||||
@ -2857,6 +2861,8 @@ send_udp(dig_query_t *query) {
|
|||||||
check_result(result, "isc_socket_create");
|
check_result(result, "isc_socket_create");
|
||||||
sockcount++;
|
sockcount++;
|
||||||
debug("sockcount=%d", sockcount);
|
debug("sockcount=%d", sockcount);
|
||||||
|
if (query->lookup->dscp != -1)
|
||||||
|
isc_socket_dscp(query->sock, query->lookup->dscp);
|
||||||
if (specified_source) {
|
if (specified_source) {
|
||||||
result = isc_socket_bind(query->sock, &bind_address,
|
result = isc_socket_bind(query->sock, &bind_address,
|
||||||
ISC_SOCKET_REUSEADDRESS);
|
ISC_SOCKET_REUSEADDRESS);
|
||||||
|
@ -195,6 +195,7 @@ isc_boolean_t sigchase;
|
|||||||
#endif
|
#endif
|
||||||
dns_ednsopt_t *ednsopts;
|
dns_ednsopt_t *ednsopts;
|
||||||
unsigned int ednsoptscnt;
|
unsigned int ednsoptscnt;
|
||||||
|
isc_dscp_t dscp;
|
||||||
};
|
};
|
||||||
|
|
||||||
/*% The dig_query structure */
|
/*% The dig_query structure */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user