From: Otto Moerbeek Date: Tue, 4 Jun 2019 09:22:40 +0000 (+0200) Subject: stubquery: Fix handling of optional type arg. X-Git-Tag: dnsdist-1.4.0-beta1~7^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F7870%2Fhead;p=thirdparty%2Fpdns.git stubquery: Fix handling of optional type arg. --- diff --git a/pdns/stubquery.cc b/pdns/stubquery.cc index afffa27b43..1da9644a2d 100644 --- a/pdns/stubquery.cc +++ b/pdns/stubquery.cc @@ -38,11 +38,13 @@ try } } - if(argc < 2) { + if(argc <= 1) { usage(); exit(EXIT_FAILURE); } + string type(argc == 2 ? "A" : argv[2]); + ::arg().set("resolver","Use this resolver for ALIAS and the internal stub resolver")="no"; reportAllTypes(); @@ -50,7 +52,7 @@ try vector ret; - int res=stubDoResolve(DNSName(argv[1]), DNSRecordContent::TypeToNumber(argv[2]), ret); + int res=stubDoResolve(DNSName(argv[1]), DNSRecordContent::TypeToNumber(type), ret); cout<<"res: "<