logstash-filter-dns 3.0.10 → 3.0.11

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 91e354fcb8db6795eda49ca3c4bcf0971eed81af89d90fec4a1f6b4ec3a9bade
4
- data.tar.gz: 377b1a63e87937e249fc439d5d332dbdd5b9fffca84830c53dd7175c9ba9b3db
3
+ metadata.gz: e49f024b4c80ef883b2293e4360c9bc8db1fed00f341291097372d0e43fda374
4
+ data.tar.gz: 6560e0fb3de4628f6cc40250d82c0de7d2a80db8116aeb66acfb43b7c2d994ea
5
5
  SHA512:
6
- metadata.gz: e5ad88694cf8f01c733a798d1bef59616eaf63d196caea8c49bd3e45a843e401d84c93ebf0125a59e621d7b3a6bd1227109e0e8ed660cd41db3a88a415f92ff9
7
- data.tar.gz: 628ec7747dafe97e40f54241f1b75f6a333aeeb0ee2841c0939143a911e45102c3068c7b6f6df9f6f2c42b777860a3db412471780b9d78f8f2bfd2dc0a826ca3
6
+ metadata.gz: 3c5f59c303e6cf2a5631c132d1d51c37cd1423f021acb79988a233652e1401a0a9bb2cbe5dfd9bb692ab7a981d3f85720552f6acecea6ad022f6c6643b953782
7
+ data.tar.gz: 95fa82bd33893694c0bd091a5e79969c4d1f1400b30cdba790fbdb33870dc081e38a34edbad0b0914dddb916b9e32299b40312cc1e92dacdbea538b2e303ad88
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## 3.0.11
2
+ - Fixed JRuby resolver bug for versions prior to 9.1.16.0 [#45](https://github.com/logstash-plugins/logstash-filter-dns/pull/45)
3
+
1
4
  ## 3.0.10
2
5
  - Log timeouts as warn instead of error #43
3
6
  - Allow concurrent queries when cache enabled #42
@@ -4,6 +4,7 @@ require "logstash/namespace"
4
4
  require "lru_redux"
5
5
  require "resolv"
6
6
  require "timeout"
7
+ require "logstash/filters/resolv_patch"
7
8
 
8
9
  java_import 'java.net.IDN'
9
10
 
@@ -0,0 +1,35 @@
1
+ require "resolv"
2
+
3
+ # ref: https://github.com/logstash-plugins/logstash-filter-dns/issues/40
4
+ #
5
+ # JRuby 9k versions prior to 9.1.16.0 have a bug which crashes IP address
6
+ # resolution after 64k unique IP addresses resolutions.
7
+ #
8
+ # Note that the oldest JRuby version in LS 6 is 9.1.13.0 and
9
+ # JRuby 1.7.25 and 1.7.27 (the 2 versions used across LS 5) are not affected by this bug.
10
+ #
11
+ # The code below is copied from JRuby 9.1.16.0 resolv.rb:
12
+ # https://github.com/jruby/jruby/blob/9.1.16.0/lib/ruby/stdlib/resolv.rb#L775-L784
13
+
14
+ JRUBY_GEM_VERSION = Gem::Version.new(JRUBY_VERSION)
15
+
16
+ if JRUBY_GEM_VERSION >= Gem::Version.new("9.1.13.0") && JRUBY_GEM_VERSION < Gem::Version.new("9.1.16.0")
17
+ class Resolv
18
+ class DNS
19
+ class Requester
20
+ class UnconnectedUDP
21
+ def sender(msg, data, host, port=Port)
22
+ sock = @socks_hash[host.index(':') ? "::" : "0.0.0.0"]
23
+ return nil if !sock
24
+ service = [IPAddr.new(host), port]
25
+ id = DNS.allocate_request_id(service[0], service[1])
26
+ request = msg.encode
27
+ request[0,2] = [id].pack('n')
28
+ return @senders[[service, id]] =
29
+ Sender.new(request, data, sock, host, port)
30
+ end
31
+ end
32
+ end
33
+ end
34
+ end
35
+ end
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
 
3
3
  s.name = 'logstash-filter-dns'
4
- s.version = '3.0.10'
4
+ s.version = '3.0.11'
5
5
  s.licenses = ['Apache License (2.0)']
6
6
  s.summary = "Performs a standard or reverse DNS lookup"
7
7
  s.description = "This gem is a Logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/logstash-plugin install gemname. This gem is not a stand-alone program"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-filter-dns
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.10
4
+ version: 3.0.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elastic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-05-11 00:00:00.000000000 Z
11
+ date: 2018-06-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
@@ -74,6 +74,7 @@ files:
74
74
  - README.md
75
75
  - docs/index.asciidoc
76
76
  - lib/logstash/filters/dns.rb
77
+ - lib/logstash/filters/resolv_patch.rb
77
78
  - logstash-filter-dns.gemspec
78
79
  - spec/filters/dns_spec.rb
79
80
  - spec/fixtures/hosts