mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-31 06:25:31 +00:00
fully remove DSCP
The "dscp" option is now marked as "ancient" and it is a configuration error to use it or to configure DSCP values for any source-address option.
This commit is contained in:
@@ -3037,7 +3037,6 @@ parse_netaddr(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret) {
|
||||
CHECK(cfg_create_obj(pctx, type, &obj));
|
||||
CHECK(cfg_parse_rawaddr(pctx, flags, &netaddr));
|
||||
isc_sockaddr_fromnetaddr(&obj->value.sockaddr, &netaddr, 0);
|
||||
obj->value.sockaddrdscp.dscp = -1;
|
||||
*ret = obj;
|
||||
return (ISC_R_SUCCESS);
|
||||
cleanup:
|
||||
@@ -3211,12 +3210,10 @@ parse_sockaddrsub(cfg_parser_t *pctx, const cfg_type_t *type, int flags,
|
||||
isc_netaddr_t netaddr;
|
||||
in_port_t port = 0;
|
||||
cfg_obj_t *obj = NULL;
|
||||
int have_port = 0, have_dscp = 0;
|
||||
cfg_obj_t *dscp = NULL;
|
||||
int have_port = 0;
|
||||
|
||||
CHECK(cfg_create_obj(pctx, type, &obj));
|
||||
CHECK(cfg_parse_rawaddr(pctx, flags, &netaddr));
|
||||
obj->value.sockaddrdscp.dscp = -1;
|
||||
for (;;) {
|
||||
CHECK(cfg_peektoken(pctx, 0));
|
||||
if (pctx->token.type == isc_tokentype_string) {
|
||||
@@ -3224,18 +3221,6 @@ parse_sockaddrsub(cfg_parser_t *pctx, const cfg_type_t *type, int flags,
|
||||
CHECK(cfg_gettoken(pctx, 0)); /* read "port" */
|
||||
CHECK(cfg_parse_rawport(pctx, flags, &port));
|
||||
++have_port;
|
||||
} else if ((flags & CFG_ADDR_DSCPOK) != 0 &&
|
||||
strcasecmp(TOKEN_STRING(pctx), "dscp") == 0)
|
||||
{
|
||||
cfg_parser_warning(pctx, 0,
|
||||
"'dscp' is obsolete and "
|
||||
"should be removed");
|
||||
CHECK(cfg_gettoken(pctx, 0)); /* read "dscp" */
|
||||
CHECK(cfg_parse_uint32(pctx, NULL, &dscp));
|
||||
obj->value.sockaddrdscp.dscp =
|
||||
cfg_obj_asuint32(dscp);
|
||||
cfg_obj_destroy(pctx, &dscp);
|
||||
++have_dscp;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
@@ -3249,11 +3234,6 @@ parse_sockaddrsub(cfg_parser_t *pctx, const cfg_type_t *type, int flags,
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (have_dscp > 1) {
|
||||
cfg_parser_error(pctx, 0, "expected at most one dscp");
|
||||
result = ISC_R_UNEXPECTEDTOKEN;
|
||||
goto cleanup;
|
||||
}
|
||||
isc_sockaddr_fromnetaddr(&obj->value.sockaddr, &netaddr, port);
|
||||
*ret = obj;
|
||||
return (ISC_R_SUCCESS);
|
||||
@@ -3268,12 +3248,6 @@ cfg_type_t cfg_type_sockaddr = { "sockaddr", cfg_parse_sockaddr,
|
||||
cfg_print_sockaddr, cfg_doc_sockaddr,
|
||||
&cfg_rep_sockaddr, &sockaddr_flags };
|
||||
|
||||
static unsigned int sockaddrdscp_flags = CFG_ADDR_V4OK | CFG_ADDR_V6OK |
|
||||
CFG_ADDR_DSCPOK;
|
||||
cfg_type_t cfg_type_sockaddrdscp = { "sockaddr", cfg_parse_sockaddr,
|
||||
cfg_print_sockaddr, cfg_doc_sockaddr,
|
||||
&cfg_rep_sockaddr, &sockaddrdscp_flags };
|
||||
|
||||
isc_result_t
|
||||
cfg_parse_sockaddr(cfg_parser_t *pctx, const cfg_type_t *type,
|
||||
cfg_obj_t **ret) {
|
||||
@@ -3305,10 +3279,6 @@ cfg_print_sockaddr(cfg_printer_t *pctx, const cfg_obj_t *obj) {
|
||||
cfg_print_cstr(pctx, " port ");
|
||||
cfg_print_rawuint(pctx, port);
|
||||
}
|
||||
if (obj->value.sockaddrdscp.dscp != -1) {
|
||||
cfg_print_cstr(pctx, " dscp ");
|
||||
cfg_print_rawuint(pctx, obj->value.sockaddrdscp.dscp);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
Reference in New Issue
Block a user