hoptracker 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/hoptracker +31 -0
- data/lib/hoptracker/prober.rb +2 -13
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dcab614c297cd2e8d0d256b65b6443fc16dd7e04661b571d1857aad5a1b3f526
|
4
|
+
data.tar.gz: 73607ff160dc26977f502965bc2b8ce5a55a610201ef2ee96cbfb4c319924795
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ed96cc43e561c069b79bd3fee6b7083ee51ea00e9653d97c2d9f6d0f5df18d68eecf169bc3eb26e8929cb5b761b999e75fdf400f1ca412ebd2804533eaabb30b
|
7
|
+
data.tar.gz: faee9e84f34268c8389a899c01c9ed1163fc1d5c402a8f404a21b56a19734edad938a6de66d2d46bd7f2090fd7cd963223b315e3de2fae0af2ebf7d23d9c0f8e
|
data/bin/hoptracker
CHANGED
@@ -4,6 +4,37 @@
|
|
4
4
|
|
5
5
|
require 'hoptracker/prober'
|
6
6
|
|
7
|
+
# Remove this when Ruby 3.4 is released
|
8
|
+
if ! (defined?(Socket::IPV6_RECVERR) && defined?(Socket::IPV6_MTU_DISCOVER))
|
9
|
+
warn 'Your Ruby version seems to be outdated. hoptracker requires a Ruby version that has fixed bug #20258.'
|
10
|
+
warn 'Try to use fallback ... this may affect the functionality of hoptracker.'
|
11
|
+
class Socket
|
12
|
+
IPV6_RECVERR = 25
|
13
|
+
IPV6_MTU_DISCOVER = 23
|
14
|
+
ResolutionError = SocketError
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
if ! (
|
19
|
+
defined?(Socket::IPPROTO_IP) &&
|
20
|
+
defined?(Socket::IP_RECVERR) &&
|
21
|
+
defined?(Socket::IP_MTU_DISCOVER) &&
|
22
|
+
defined?(Socket::IP_RECVTTL)
|
23
|
+
)
|
24
|
+
warn 'Your Ruby version does not seem to support the required IPv4 functionalities. hoptracker can therefore not be executed.'
|
25
|
+
exit 1
|
26
|
+
end
|
27
|
+
|
28
|
+
if ! (
|
29
|
+
defined?(Socket::IPPROTO_IPV6) &&
|
30
|
+
defined?(Socket::IPV6_RECVERR) &&
|
31
|
+
defined?(Socket::IPV6_MTU_DISCOVER) &&
|
32
|
+
defined?(Socket::IPV6_RECVHOPLIMIT)
|
33
|
+
)
|
34
|
+
warn 'Your Ruby version does not seem to support the required IPv6 functionalities. hoptracker can therefore not be executed.'
|
35
|
+
exit 1
|
36
|
+
end
|
37
|
+
|
7
38
|
prober = HopTracker::Prober.new ARGV[0]
|
8
39
|
|
9
40
|
# Set the MTU to the maximum and the TTL counter to 1
|
data/lib/hoptracker/prober.rb
CHANGED
@@ -46,20 +46,9 @@ module HopTracker
|
|
46
46
|
@socket = @destination.connect
|
47
47
|
|
48
48
|
# Next, we allow errors to be received, which means that we will later have ICMP error messages. Furthermore, we set the flag for MTU Discover so that packets are not fragmented. We also want to know the TTL of the packet we are receiving.
|
49
|
-
# Requires patch for IPv6
|
50
49
|
if @destination.ipv6?
|
51
|
-
|
52
|
-
|
53
|
-
# [2] https://github.com/ruby/ruby/pull/9930
|
54
|
-
if defined?(Socket::IPV6_RECVERR) && defined?(Socket::IPV6_MTU_DISCOVER)
|
55
|
-
@socket.setsockopt Socket::IPPROTO_IPV6, Socket::IPV6_RECVERR, 1
|
56
|
-
@socket.setsockopt Socket::IPPROTO_IPV6, Socket::IPV6_MTU_DISCOVER, 3
|
57
|
-
else
|
58
|
-
# Since the program should still try to work, we use frequently used numbers as a fallback.
|
59
|
-
warn "Please use a Ruby version that includes PR#9930 on GitHub or has closed bug #20258. Using fallback numbers... This can lead to errors."
|
60
|
-
@socket.setsockopt Socket::IPPROTO_IPV6, 25, 1
|
61
|
-
@socket.setsockopt Socket::IPPROTO_IPV6, 23, 3
|
62
|
-
end
|
50
|
+
@socket.setsockopt Socket::IPPROTO_IPV6, Socket::IPV6_RECVERR, 1
|
51
|
+
@socket.setsockopt Socket::IPPROTO_IPV6, Socket::IPV6_MTU_DISCOVER, 3
|
63
52
|
@socket.setsockopt Socket::IPPROTO_IPV6, Socket::IPV6_RECVHOPLIMIT, 1
|
64
53
|
else
|
65
54
|
@socket.setsockopt Socket::IPPROTO_IP, Socket::IP_RECVERR, 1
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hoptracker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marek Küthe
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-02-
|
11
|
+
date: 2024-02-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: msgpack
|