rex-socket 0.1.13 → 0.1.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/lib/rex/socket.rb +8 -5
- data/lib/rex/socket/version.rb +1 -1
- metadata +2 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c071cc13e6d51ecc958ae811200859e60675a57f
|
4
|
+
data.tar.gz: 661b1ebf9f43c87f1ef5f7760e484960db8267ec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7f7ae577e318e988bb740583ba15fbcb2a1944a3b2a19b9a29da7ce188feff89257eda4c382107ad1f790c539e4406bfb6a5f4ae06f6c3cb4d0583581b80eaff
|
7
|
+
data.tar.gz: 9ce5bd1040689fdb16605e9ddb214c821ff62e928c4b59eaa1372681f03f02b3a7f8c5b4ff8fa2c235a7a56bc854998995e14dfc2ce329a8204dda2643dfa50b
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/rex/socket.rb
CHANGED
@@ -289,10 +289,11 @@ module Socket
|
|
289
289
|
# nil if it's not convertable.
|
290
290
|
#
|
291
291
|
def self.addr_atoc(mask)
|
292
|
+
bits = is_ipv6?(mask) ? 128 : 32
|
292
293
|
mask_i = resolv_nbo_i(mask)
|
293
294
|
cidr = nil
|
294
|
-
0.upto(
|
295
|
-
if ((1 << i)-1) << (
|
295
|
+
0.upto(bits) do |i|
|
296
|
+
if ((1 << i)-1) << (bits - i) == mask_i
|
296
297
|
cidr = i
|
297
298
|
break
|
298
299
|
end
|
@@ -304,9 +305,11 @@ module Socket
|
|
304
305
|
# Resolves a CIDR bitmask into a dotted-quad. Returns
|
305
306
|
# nil if it's not convertable.
|
306
307
|
#
|
307
|
-
def self.addr_ctoa(cidr)
|
308
|
-
|
309
|
-
|
308
|
+
def self.addr_ctoa(cidr, v6: false)
|
309
|
+
bits = v6 ? 128 : 32
|
310
|
+
cidr = cidr.to_i
|
311
|
+
return nil unless (0..bits) === cidr
|
312
|
+
addr_itoa(((1 << cidr)-1) << bits-cidr, v6)
|
310
313
|
end
|
311
314
|
|
312
315
|
#
|
data/lib/rex/socket/version.rb
CHANGED
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.
|
4
|
+
version: 0.1.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Maloney
|
@@ -88,7 +88,7 @@ cert_chain:
|
|
88
88
|
G+Hmcg1v810agasPdoydE0RTVZgEOOMoQ07qu7JFXVWZ9ZQpHT7qJATWL/b2csFG
|
89
89
|
8mVuTXnyJOKRJA==
|
90
90
|
-----END CERTIFICATE-----
|
91
|
-
date: 2018-03
|
91
|
+
date: 2018-04-03 00:00:00.000000000 Z
|
92
92
|
dependencies:
|
93
93
|
- !ruby/object:Gem::Dependency
|
94
94
|
name: bundler
|
metadata.gz.sig
CHANGED
Binary file
|