diff options
author | thegeorg <thegeorg@yandex-team.com> | 2023-11-16 12:09:30 +0300 |
---|---|---|
committer | thegeorg <thegeorg@yandex-team.com> | 2023-11-16 12:45:04 +0300 |
commit | 1230368525c69fd8f92bb3bbff1cbc049581e703 (patch) | |
tree | 55910c62ce19890f0ef32d08fb2ff91fab731430 | |
parent | d0bed9523e6cdc3911fcf5ff782e0bcf15d1e393 (diff) | |
download | ydb-1230368525c69fd8f92bb3bbff1cbc049581e703.tar.gz |
Fix reimport for contrib/libs/c-ares after rXXXXXX
-rw-r--r-- | contrib/libs/c-ares/include/ares.h | 9 | ||||
-rw-r--r-- | contrib/libs/c-ares/src/lib/ares_gethostbyaddr.c | 4 | ||||
-rw-r--r-- | contrib/libs/c-ares/src/lib/ares_parse_mx_reply.c | 4 | ||||
-rw-r--r-- | contrib/libs/c-ares/src/lib/ares_parse_naptr_reply.c | 4 | ||||
-rw-r--r-- | contrib/libs/c-ares/src/lib/ares_parse_ptr_reply.c | 19 | ||||
-rw-r--r-- | contrib/libs/c-ares/src/lib/ares_parse_soa_reply.c | 3 | ||||
-rw-r--r-- | contrib/libs/c-ares/src/lib/ares_parse_srv_reply.c | 4 | ||||
-rw-r--r-- | contrib/libs/c-ares/src/lib/ares_parse_txt_reply.c | 4 | ||||
-rw-r--r-- | contrib/libs/c-ares/test/ares-test-parse-ptr.cc | 28 |
9 files changed, 23 insertions, 56 deletions
diff --git a/contrib/libs/c-ares/include/ares.h b/contrib/libs/c-ares/include/ares.h index ffee1e753f..ac8a22f0a6 100644 --- a/contrib/libs/c-ares/include/ares.h +++ b/contrib/libs/c-ares/include/ares.h @@ -569,21 +569,18 @@ struct ares_srv_reply { unsigned short priority; unsigned short weight; unsigned short port; - int ttl; }; struct ares_mx_reply { struct ares_mx_reply *next; char *host; unsigned short priority; - int ttl; }; struct ares_txt_reply { struct ares_txt_reply *next; unsigned char *txt; size_t length; /* length excludes null termination */ - int ttl; }; /* NOTE: This structure is a superset of ares_txt_reply @@ -595,7 +592,6 @@ struct ares_txt_ext { /* 1 - if start of new record * 0 - if a chunk in the same record */ unsigned char record_start; - int ttl; }; struct ares_naptr_reply { @@ -606,7 +602,6 @@ struct ares_naptr_reply { char *replacement; unsigned short order; unsigned short preference; - int ttl; }; struct ares_soa_reply { @@ -617,7 +612,6 @@ struct ares_soa_reply { unsigned int retry; unsigned int expire; unsigned int minttl; - int ttl; }; struct ares_uri_reply { @@ -696,8 +690,7 @@ CARES_EXTERN int ares_parse_ptr_reply(const unsigned char *abuf, const void *addr, int addrlen, int family, - struct hostent **host, - int *hostttl); + struct hostent **host); CARES_EXTERN int ares_parse_ns_reply(const unsigned char *abuf, int alen, diff --git a/contrib/libs/c-ares/src/lib/ares_gethostbyaddr.c b/contrib/libs/c-ares/src/lib/ares_gethostbyaddr.c index 90187e2842..628813057b 100644 --- a/contrib/libs/c-ares/src/lib/ares_gethostbyaddr.c +++ b/contrib/libs/c-ares/src/lib/ares_gethostbyaddr.c @@ -153,13 +153,13 @@ static void addr_callback(void *arg, int status, int timeouts, { addrlen = sizeof(aquery->addr.addrV4); status = ares_parse_ptr_reply(abuf, alen, &aquery->addr.addrV4, - (int)addrlen, AF_INET, &host, NULL); + (int)addrlen, AF_INET, &host); } else { addrlen = sizeof(aquery->addr.addrV6); status = ares_parse_ptr_reply(abuf, alen, &aquery->addr.addrV6, - (int)addrlen, AF_INET6, &host, NULL); + (int)addrlen, AF_INET6, &host); } end_aquery(aquery, status, host); } diff --git a/contrib/libs/c-ares/src/lib/ares_parse_mx_reply.c b/contrib/libs/c-ares/src/lib/ares_parse_mx_reply.c index 0015a1f76c..36dfe3d933 100644 --- a/contrib/libs/c-ares/src/lib/ares_parse_mx_reply.c +++ b/contrib/libs/c-ares/src/lib/ares_parse_mx_reply.c @@ -50,7 +50,7 @@ ares_parse_mx_reply (const unsigned char *abuf, int alen, { unsigned int qdcount, ancount, i; const unsigned char *aptr, *vptr; - int status, rr_type, rr_class, rr_len, rr_ttl; + int status, rr_type, rr_class, rr_len; long len; char *hostname = NULL, *rr_name = NULL; struct ares_mx_reply *mx_head = NULL; @@ -103,7 +103,6 @@ ares_parse_mx_reply (const unsigned char *abuf, int alen, rr_type = DNS_RR_TYPE (aptr); rr_class = DNS_RR_CLASS (aptr); rr_len = DNS_RR_LEN (aptr); - rr_ttl = DNS_RR_TTL (aptr); aptr += RRFIXEDSZ; if (aptr + rr_len > abuf + alen) { @@ -140,7 +139,6 @@ ares_parse_mx_reply (const unsigned char *abuf, int alen, vptr = aptr; mx_curr->priority = DNS__16BIT(vptr); - mx_curr->ttl = rr_ttl; vptr += sizeof(unsigned short); status = ares_expand_name (vptr, abuf, alen, &mx_curr->host, &len); diff --git a/contrib/libs/c-ares/src/lib/ares_parse_naptr_reply.c b/contrib/libs/c-ares/src/lib/ares_parse_naptr_reply.c index d0eca374ec..81dfb02a2a 100644 --- a/contrib/libs/c-ares/src/lib/ares_parse_naptr_reply.c +++ b/contrib/libs/c-ares/src/lib/ares_parse_naptr_reply.c @@ -49,7 +49,7 @@ ares_parse_naptr_reply (const unsigned char *abuf, int alen, { unsigned int qdcount, ancount, i; const unsigned char *aptr, *vptr; - int status, rr_type, rr_class, rr_len, rr_ttl; + int status, rr_type, rr_class, rr_len; long len; char *hostname = NULL, *rr_name = NULL; struct ares_naptr_reply *naptr_head = NULL; @@ -102,7 +102,6 @@ ares_parse_naptr_reply (const unsigned char *abuf, int alen, rr_type = DNS_RR_TYPE (aptr); rr_class = DNS_RR_CLASS (aptr); rr_len = DNS_RR_LEN (aptr); - rr_ttl = DNS_RR_TTL (aptr); aptr += RRFIXEDSZ; if (aptr + rr_len > abuf + alen) { @@ -139,7 +138,6 @@ ares_parse_naptr_reply (const unsigned char *abuf, int alen, } naptr_last = naptr_curr; - naptr_curr->ttl = rr_ttl; vptr = aptr; naptr_curr->order = DNS__16BIT(vptr); vptr += sizeof(unsigned short); diff --git a/contrib/libs/c-ares/src/lib/ares_parse_ptr_reply.c b/contrib/libs/c-ares/src/lib/ares_parse_ptr_reply.c index 9afb5e3e8c..0606d35f1e 100644 --- a/contrib/libs/c-ares/src/lib/ares_parse_ptr_reply.c +++ b/contrib/libs/c-ares/src/lib/ares_parse_ptr_reply.c @@ -40,21 +40,16 @@ # include <strings.h> #endif -#ifdef HAVE_LIMITS_H -# include <limits.h> -#endif - #include "ares.h" #include "ares_dns.h" #include "ares_nowarn.h" #include "ares_private.h" int ares_parse_ptr_reply(const unsigned char *abuf, int alen, const void *addr, - int addrlen, int family, struct hostent **host, - int *hostttl) + int addrlen, int family, struct hostent **host) { unsigned int qdcount, ancount; - int status, i, rr_type, rr_class, rr_len, rr_ttl; + int status, i, rr_type, rr_class, rr_len; long len; const unsigned char *aptr; char *ptrname, *hostname, *rr_name, *rr_data; @@ -66,8 +61,6 @@ int ares_parse_ptr_reply(const unsigned char *abuf, int alen, const void *addr, /* Set *host to NULL for all failure cases. */ *host = NULL; - if (hostttl) - *hostttl = INT_MAX; /* Give up if abuf doesn't have room for a header. */ if (alen < HFIXEDSZ) @@ -115,7 +108,6 @@ int ares_parse_ptr_reply(const unsigned char *abuf, int alen, const void *addr, rr_type = DNS_RR_TYPE(aptr); rr_class = DNS_RR_CLASS(aptr); rr_len = DNS_RR_LEN(aptr); - rr_ttl = DNS_RR_TTL(aptr); aptr += RRFIXEDSZ; if (aptr + rr_len > abuf + alen) { @@ -159,13 +151,6 @@ int ares_parse_ptr_reply(const unsigned char *abuf, int alen, const void *addr, } aliases = ptr; } - if (hostttl) - { - if (*hostttl > rr_ttl) - { - *hostttl = rr_ttl; - } - } } if (rr_class == C_IN && rr_type == T_CNAME) diff --git a/contrib/libs/c-ares/src/lib/ares_parse_soa_reply.c b/contrib/libs/c-ares/src/lib/ares_parse_soa_reply.c index 8a205c84e1..f37ba19173 100644 --- a/contrib/libs/c-ares/src/lib/ares_parse_soa_reply.c +++ b/contrib/libs/c-ares/src/lib/ares_parse_soa_reply.c @@ -54,7 +54,6 @@ ares_parse_soa_reply(const unsigned char *abuf, int alen, struct ares_soa_reply *soa = NULL; int qdcount, ancount, qclass; int status, i, rr_type, rr_class, rr_len; - int ttl; if (alen < HFIXEDSZ) return ARES_EBADRESP; @@ -111,7 +110,6 @@ ares_parse_soa_reply(const unsigned char *abuf, int alen, rr_type = DNS_RR_TYPE( aptr ); rr_class = DNS_RR_CLASS( aptr ); rr_len = DNS_RR_LEN( aptr ); - ttl = DNS_RR_TTL(aptr); aptr += RRFIXEDSZ; if (aptr + rr_len > abuf + alen) { @@ -161,7 +159,6 @@ ares_parse_soa_reply(const unsigned char *abuf, int alen, soa->retry = DNS__32BIT(aptr + 2 * 4); soa->expire = DNS__32BIT(aptr + 3 * 4); soa->minttl = DNS__32BIT(aptr + 4 * 4); - soa->ttl = ttl; ares_free(qname); ares_free(rr_name); diff --git a/contrib/libs/c-ares/src/lib/ares_parse_srv_reply.c b/contrib/libs/c-ares/src/lib/ares_parse_srv_reply.c index 0ff7659483..0125092c02 100644 --- a/contrib/libs/c-ares/src/lib/ares_parse_srv_reply.c +++ b/contrib/libs/c-ares/src/lib/ares_parse_srv_reply.c @@ -50,7 +50,7 @@ ares_parse_srv_reply (const unsigned char *abuf, int alen, { unsigned int qdcount, ancount, i; const unsigned char *aptr, *vptr; - int status, rr_type, rr_class, rr_len, rr_ttl; + int status, rr_type, rr_class, rr_len; long len; char *hostname = NULL, *rr_name = NULL; struct ares_srv_reply *srv_head = NULL; @@ -103,7 +103,6 @@ ares_parse_srv_reply (const unsigned char *abuf, int alen, rr_type = DNS_RR_TYPE (aptr); rr_class = DNS_RR_CLASS (aptr); rr_len = DNS_RR_LEN (aptr); - rr_ttl = DNS_RR_TTL(aptr); aptr += RRFIXEDSZ; if (aptr + rr_len > abuf + alen) { @@ -145,7 +144,6 @@ ares_parse_srv_reply (const unsigned char *abuf, int alen, vptr += sizeof(unsigned short); srv_curr->port = DNS__16BIT(vptr); vptr += sizeof(unsigned short); - srv_curr->ttl = rr_ttl; status = ares_expand_name (vptr, abuf, alen, &srv_curr->host, &len); if (status != ARES_SUCCESS) diff --git a/contrib/libs/c-ares/src/lib/ares_parse_txt_reply.c b/contrib/libs/c-ares/src/lib/ares_parse_txt_reply.c index a0f998ec8a..083cbf4dff 100644 --- a/contrib/libs/c-ares/src/lib/ares_parse_txt_reply.c +++ b/contrib/libs/c-ares/src/lib/ares_parse_txt_reply.c @@ -56,7 +56,7 @@ ares__parse_txt_reply (const unsigned char *abuf, int alen, unsigned int qdcount, ancount, i; const unsigned char *aptr; const unsigned char *strptr; - int status, rr_type, rr_class, rr_len, rr_ttl; + int status, rr_type, rr_class, rr_len; long len; char *hostname = NULL, *rr_name = NULL; struct ares_txt_ext *txt_head = NULL; @@ -109,7 +109,6 @@ ares__parse_txt_reply (const unsigned char *abuf, int alen, rr_type = DNS_RR_TYPE (aptr); rr_class = DNS_RR_CLASS (aptr); rr_len = DNS_RR_LEN (aptr); - rr_ttl = DNS_RR_TTL (aptr); aptr += RRFIXEDSZ; if (aptr + rr_len > abuf + alen) { @@ -171,7 +170,6 @@ ares__parse_txt_reply (const unsigned char *abuf, int alen, /* Make sure we NULL-terminate */ txt_curr->txt[substr_len] = 0; - txt_curr->ttl = rr_ttl; strptr += substr_len; } diff --git a/contrib/libs/c-ares/test/ares-test-parse-ptr.cc b/contrib/libs/c-ares/test/ares-test-parse-ptr.cc index a721823062..3119240060 100644 --- a/contrib/libs/c-ares/test/ares-test-parse-ptr.cc +++ b/contrib/libs/c-ares/test/ares-test-parse-ptr.cc @@ -34,7 +34,7 @@ TEST_F(LibraryTest, ParsePtrReplyOK) { struct hostent *host = nullptr; EXPECT_EQ(ARES_SUCCESS, ares_parse_ptr_reply(data.data(), data.size(), - addrv4, sizeof(addrv4), AF_INET, &host, NULL)); + addrv4, sizeof(addrv4), AF_INET, &host)); ASSERT_NE(nullptr, host); std::stringstream ss; ss << HostEnt(host); @@ -53,7 +53,7 @@ TEST_F(LibraryTest, ParsePtrReplyCname) { struct hostent *host = nullptr; EXPECT_EQ(ARES_SUCCESS, ares_parse_ptr_reply(data.data(), data.size(), - addrv4, sizeof(addrv4), AF_INET, &host, NULL)); + addrv4, sizeof(addrv4), AF_INET, &host)); ASSERT_NE(nullptr, host); std::stringstream ss; ss << HostEnt(host); @@ -87,7 +87,7 @@ TEST_F(LibraryTest, ParsePtrReplyMalformedCname) { struct hostent *host = nullptr; EXPECT_EQ(ARES_EBADRESP, ares_parse_ptr_reply(data.data(), data.size(), - addrv4, sizeof(addrv4), AF_INET, &host, NULL)); + addrv4, sizeof(addrv4), AF_INET, &host)); ASSERT_EQ(nullptr, host); } @@ -110,7 +110,7 @@ TEST_F(LibraryTest, ParseManyPtrReply) { struct hostent *host = nullptr; EXPECT_EQ(ARES_SUCCESS, ares_parse_ptr_reply(data.data(), data.size(), - addrv4, sizeof(addrv4), AF_INET, &host, NULL)); + addrv4, sizeof(addrv4), AF_INET, &host)); ASSERT_NE(nullptr, host); ares_free_hostent(host); } @@ -131,7 +131,7 @@ TEST_F(LibraryTest, ParsePtrReplyAdditional) { struct hostent *host = nullptr; EXPECT_EQ(ARES_SUCCESS, ares_parse_ptr_reply(data.data(), data.size(), - addrv4, sizeof(addrv4), AF_INET, &host, NULL)); + addrv4, sizeof(addrv4), AF_INET, &host)); ASSERT_NE(nullptr, host); std::stringstream ss; ss << HostEnt(host); @@ -152,7 +152,7 @@ TEST_F(LibraryTest, ParsePtrReplyErrors) { pkt.questions_.clear(); data = pkt.data(); EXPECT_EQ(ARES_EBADRESP, ares_parse_ptr_reply(data.data(), data.size(), - addrv4, sizeof(addrv4), AF_INET, &host, NULL)); + addrv4, sizeof(addrv4), AF_INET, &host)); pkt.add_question(new DNSQuestion("64.48.32.16.in-addr.arpa", T_PTR)); // Question != answer @@ -160,7 +160,7 @@ TEST_F(LibraryTest, ParsePtrReplyErrors) { pkt.add_question(new DNSQuestion("99.48.32.16.in-addr.arpa", T_PTR)); data = pkt.data(); EXPECT_EQ(ARES_ENODATA, ares_parse_ptr_reply(data.data(), data.size(), - addrv4, sizeof(addrv4), AF_INET, &host, NULL)); + addrv4, sizeof(addrv4), AF_INET, &host)); EXPECT_EQ(nullptr, host); pkt.questions_.clear(); pkt.add_question(new DNSQuestion("64.48.32.16.in-addr.arpa", T_PTR)); @@ -169,7 +169,7 @@ TEST_F(LibraryTest, ParsePtrReplyErrors) { pkt.add_question(new DNSQuestion("64.48.32.16.in-addr.arpa", T_PTR)); data = pkt.data(); EXPECT_EQ(ARES_EBADRESP, ares_parse_ptr_reply(data.data(), data.size(), - addrv4, sizeof(addrv4), AF_INET, &host, NULL)); + addrv4, sizeof(addrv4), AF_INET, &host)); EXPECT_EQ(nullptr, host); pkt.questions_.clear(); pkt.add_question(new DNSQuestion("64.48.32.16.in-addr.arpa", T_PTR)); @@ -179,7 +179,7 @@ TEST_F(LibraryTest, ParsePtrReplyErrors) { pkt.add_answer(new DNSMxRR("example.com", 100, 100, "mx1.example.com")); data = pkt.data(); EXPECT_EQ(ARES_ENODATA, ares_parse_ptr_reply(data.data(), data.size(), - addrv4, sizeof(addrv4), AF_INET, &host, NULL)); + addrv4, sizeof(addrv4), AF_INET, &host)); EXPECT_EQ(nullptr, host); pkt.answers_.clear(); pkt.add_answer(new DNSPtrRR("64.48.32.16.in-addr.arpa", 100, "other.com")); @@ -188,7 +188,7 @@ TEST_F(LibraryTest, ParsePtrReplyErrors) { pkt.answers_.clear(); data = pkt.data(); EXPECT_EQ(ARES_ENODATA, ares_parse_ptr_reply(data.data(), data.size(), - addrv4, sizeof(addrv4), AF_INET, &host, NULL)); + addrv4, sizeof(addrv4), AF_INET, &host)); EXPECT_EQ(nullptr, host); pkt.add_answer(new DNSPtrRR("64.48.32.16.in-addr.arpa", 100, "other.com")); @@ -196,7 +196,7 @@ TEST_F(LibraryTest, ParsePtrReplyErrors) { data = pkt.data(); for (size_t len = 1; len < data.size(); len++) { EXPECT_EQ(ARES_EBADRESP, ares_parse_ptr_reply(data.data(), len, - addrv4, sizeof(addrv4), AF_INET, &host, NULL)); + addrv4, sizeof(addrv4), AF_INET, &host)); EXPECT_EQ(nullptr, host); } @@ -205,7 +205,7 @@ TEST_F(LibraryTest, ParsePtrReplyErrors) { data = pkt.data(); for (size_t len = 1; len < data.size(); len++) { EXPECT_EQ(ARES_EBADRESP, ares_parse_ptr_reply(data.data(), len, - addrv4, sizeof(addrv4), AF_INET, &host, NULL)); + addrv4, sizeof(addrv4), AF_INET, &host)); EXPECT_EQ(nullptr, host); } } @@ -226,7 +226,7 @@ TEST_F(LibraryTest, ParsePtrReplyAllocFailSome) { ClearFails(); SetAllocFail(ii); EXPECT_EQ(ARES_ENOMEM, ares_parse_ptr_reply(data.data(), data.size(), - addrv4, sizeof(addrv4), AF_INET, &host, NULL)) << ii; + addrv4, sizeof(addrv4), AF_INET, &host)) << ii; } } @@ -252,7 +252,7 @@ TEST_F(LibraryTest, ParsePtrReplyAllocFailMany) { ClearFails(); SetAllocFail(ii); int rc = ares_parse_ptr_reply(data.data(), data.size(), - addrv4, sizeof(addrv4), AF_INET, &host, NULL); + addrv4, sizeof(addrv4), AF_INET, &host); if (rc != ARES_ENOMEM) { EXPECT_EQ(ARES_SUCCESS, rc); ares_free_hostent(host); |