rex-socket 0.1.31 → 0.1.32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 398f01b37a1c460126d7d3d375f0bf332667e025402c71864637d3c9803de7f4
4
- data.tar.gz: ee7bb9810a863055fdf614671831ed60ce2397e524f53aa8c5e211bb274670ab
3
+ metadata.gz: e4459a7bb29271ef6914325cf3d6b0b11f94056a55286cc91d1060f0c7f7afbb
4
+ data.tar.gz: 04a369427c1462a168ceb6f252e7f6a2987f35ef9ec47a582a35976ef7c0340c
5
5
  SHA512:
6
- metadata.gz: 404fd949220d753521ba39f90cea3fab95668519a293c496ec5e1689a004467a30ca948cb42fd81744cc56e5a50976a97c96be786403a8f90b84514c52d8330e
7
- data.tar.gz: 5b940b7536739271b96f9cf97008d3c490a54cdac119b0b9bbe42848c29ee21e78058c989f65c9a50384d0ac291a003f5a86b5a09904cee0c9aca31de9a576ef
6
+ metadata.gz: d848f4b6df65942a810b7f24488f45d859bc6bdd11189afd131235f0c9cab0824c1e66fc95f0edf06ac91cae1f0f9d50d9820177fabcace2bb6824bc9dc108c2
7
+ data.tar.gz: 8baa414c06a8b13282c74d0d55c5edd7e7dff43c7304d1604f476f78195b0d2514ac72b22679b01387a25f16c4bc382c97b3181d3b9b5fe1aecd1bafb566f3d7
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -192,7 +192,15 @@ class Rex::Socket::Parameters
192
192
  end
193
193
 
194
194
  # Whether to force IPv6 addressing
195
- self.v6 = hash['IPv6']
195
+ if hash['IPv6'].nil?
196
+ # if IPv6 isn't specified and at least one host is an IPv6 address and the
197
+ # other is either nil, a hostname or an IPv6 address, then use IPv6
198
+ self.v6 = (Rex::Socket.is_ipv6?(self.localhost) || Rex::Socket.is_ipv6?(self.peerhost)) && \
199
+ (self.localhost.nil? || !Rex::Socket.is_ipv4?(self.localhost)) && \
200
+ (self.peerhost.nil? || !Rex::Socket.is_ipv4?(self.peerhost))
201
+ else
202
+ self.v6 = hash['IPv6']
203
+ end
196
204
  end
197
205
 
198
206
  def merge(other)
@@ -294,7 +302,13 @@ class Rex::Socket::Parameters
294
302
  # @return [String]
295
303
  attr_writer :localhost
296
304
  def localhost
297
- @localhost || '0.0.0.0'
305
+ return @localhost if @localhost
306
+
307
+ if @v6 || (@peerhost && Rex::Socket.is_ipv6?(@peerhost))
308
+ '::'
309
+ else
310
+ '0.0.0.0'
311
+ end
298
312
  end
299
313
 
300
314
  # The local port. Equivalent to the LocalPort parameter hash key.
@@ -1,5 +1,5 @@
1
1
  module Rex
2
2
  module Socket
3
- VERSION = "0.1.31"
3
+ VERSION = "0.1.32"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rex-socket
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.31
4
+ version: 0.1.32
5
5
  platform: ruby
6
6
  authors:
7
7
  - Metasploit Hackers
metadata.gz.sig CHANGED
Binary file