summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2022-01-16 22:41:16 +0100
committerDaniel Stenberg <daniel@haxx.se>2022-01-17 08:44:41 +0100
commit0041fe7ef5e32408865bc543897a42f5e2ea376e (patch)
treeafecb01979ff81eba34a536fde7a57071080f16a
parentf974bee6235ea049667e9c8f8edc2c84cc5e0f91 (diff)
downloadcurl-0041fe7ef5e32408865bc543897a42f5e2ea376e.tar.gz
tool_getparam: DNS options that need c-ares now fail without it
Just silently accepting the options and then not having any effect is not good. Ref: #8283 Closes #8285
-rw-r--r--src/tool_getparam.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/tool_getparam.c b/src/tool_getparam.c
index 223214b0a..14dca833c 100644
--- a/src/tool_getparam.c
+++ b/src/tool_getparam.c
@@ -654,10 +654,14 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */
case '*': /* options without a short option */
switch(subletter) {
case '4': /* --dns-ipv4-addr */
+ if(!curlinfo->ares_num) /* c-ares is needed for this */
+ return PARAM_LIBCURL_DOESNT_SUPPORT;
/* addr in dot notation */
GetStr(&config->dns_ipv4_addr, nextarg);
break;
case '6': /* --dns-ipv6-addr */
+ if(!curlinfo->ares_num) /* c-ares is needed for this */
+ return PARAM_LIBCURL_DOESNT_SUPPORT;
/* addr in dot notation */
GetStr(&config->dns_ipv6_addr, nextarg);
break;
@@ -685,6 +689,8 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */
GetStr(&config->cipher_list, nextarg);
break;
case 'D': /* --dns-interface */
+ if(!curlinfo->ares_num) /* c-ares is needed for this */
+ return PARAM_LIBCURL_DOESNT_SUPPORT;
/* interface name */
GetStr(&config->dns_interface, nextarg);
break;
@@ -698,6 +704,8 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */
config->disable_epsv = (!toggle)?TRUE:FALSE;
break;
case 'F': /* --dns-servers */
+ if(!curlinfo->ares_num) /* c-ares is needed for this */
+ return PARAM_LIBCURL_DOESNT_SUPPORT;
/* IP addrs of DNS servers */
GetStr(&config->dns_servers, nextarg);
break;