summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2021-07-03 16:56:34 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2021-07-03 16:56:34 +0000
commit83c255e89f376068f632fc1f17e67253184e4451 (patch)
tree69bd82f19ceaf338fbc5c2e8cd3f75587034765d
parent67b324529b378c34fcc0fd910fa4139fc6cc5478 (diff)
merge revision(s) 9edc1625: [Backport #17781]
[ruby/resolv] Fix confusion of received response message This is a follow up for commit 33fb966197f1 ("Remove sender/message_id pair after response received in resolv", 2020-09-11). As the @senders instance variable is also used for tracking transaction ID allocation, simply removing an entry without releasing the ID would eventually deplete the ID space and cause Resolv::DNS.allocate_request_id to hang. It seems the intention of the code was to check that the received DNS message is actually the response for the question made within the method earlier. Let's have it actually do so. [Bug #12838] https://bugs.ruby-lang.org/issues/12838 [Bug #17748] https://bugs.ruby-lang.org/issues/17748 https://github.com/ruby/resolv/commit/53ca9c9209 --- lib/resolv.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_6@67946 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--lib/resolv.rb6
-rw-r--r--version.h2
2 files changed, 4 insertions, 4 deletions
diff --git a/lib/resolv.rb b/lib/resolv.rb
index 93b57c62d8..02c2dedc49 100644
--- a/lib/resolv.rb
+++ b/lib/resolv.rb
@@ -691,17 +691,17 @@ class Resolv
rescue DecodeError
next # broken DNS message ignored
end
- if s = sender_for(from, msg)
+ if sender == sender_for(from, msg)
break
else
# unexpected DNS message ignored
end
end
- return msg, s.data
+ return msg, sender.data
end
def sender_for(addr, msg)
- @senders.delete([addr,msg.id])
+ @senders[[addr,msg.id]]
end
def close
diff --git a/version.h b/version.h
index 31a7605f40..e6003c2f6a 100644
--- a/version.h
+++ b/version.h
@@ -1,6 +1,6 @@
#define RUBY_VERSION "2.6.8"
#define RUBY_RELEASE_DATE "2021-07-04"
-#define RUBY_PATCHLEVEL 201
+#define RUBY_PATCHLEVEL 202
#define RUBY_RELEASE_YEAR 2021
#define RUBY_RELEASE_MONTH 7