hoptracker 1.0.1 → 1.0.3

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: 3b2d45f18ef14df49e8ca3a2213147a84da7f846e7a139057eea1425ba605472
4
- data.tar.gz: e1b54172ac32ed799919288f81e12f2d9b196e9c5dc88e55a53952994417a9a3
3
+ metadata.gz: dcab614c297cd2e8d0d256b65b6443fc16dd7e04661b571d1857aad5a1b3f526
4
+ data.tar.gz: 73607ff160dc26977f502965bc2b8ce5a55a610201ef2ee96cbfb4c319924795
5
5
  SHA512:
6
- metadata.gz: a1e2035b7f493a921d8cfdb6c3770a8d8e07392bddb0d3a790f9257f4a2a9d2c45995f423c2a60883c2fb0cd2d8b3af7e3d2fcf6f2325005a122ab58c9a51aad
7
- data.tar.gz: e13cde78fb81531cc665ae319925139b973bea0ddb093e30312754c8a575e9ce2a8421079e23fb34f9601f79ffdb63b591f8722e6b0ba5d2d5c9b690f1a2589f
6
+ metadata.gz: ed96cc43e561c069b79bd3fee6b7083ee51ea00e9653d97c2d9f6d0f5df18d68eecf169bc3eb26e8929cb5b761b999e75fdf400f1ca412ebd2804533eaabb30b
7
+ data.tar.gz: faee9e84f34268c8389a899c01c9ed1163fc1d5c402a8f404a21b56a19734edad938a6de66d2d46bd7f2090fd7cd963223b315e3de2fae0af2ebf7d23d9c0f8e
data/README.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # hoptracker
2
2
 
3
+ hoptracker is a paris-traceroute-like program that can discover the hops in the path, the path MTU and where it changes, measure the TTL/hop limit, guess asymmetric return paths and measure the latency to each hop.
4
+
5
+ To use hoptracker to its full extent, please use a Ruby version that has PR#9930 included on GitHub or otherwise closes bug #20258.
6
+
3
7
  hoptracker has the following range of functions:
4
8
  - Determine the hops on the path.
5
9
  - Determine the MTU of the path and where it changes.
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
@@ -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
- # Some constants are currently missing for IPv6. I have created both a bug report [1] and a PR [2] for this.
52
- # [1] https://bugs.ruby-lang.org/issues/20258
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
@@ -311,7 +300,7 @@ module HopTracker
311
300
  retry
312
301
  rescue Errno::EMSGSIZE => e
313
302
  # Ignore MTU errors when sending, as we process the error later when receiving the error message
314
- warn "Failed to send probe: #{e.message} - that's okay!"
303
+ # warn "Failed to send probe: #{e.message} - that's okay!"
315
304
  end
316
305
  probes << {
317
306
  send_time: Time.now
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.1
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-21 00:00:00.000000000 Z
11
+ date: 2024-02-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: msgpack
@@ -89,7 +89,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
89
89
  - !ruby/object:Gem::Version
90
90
  version: '0'
91
91
  requirements: []
92
- rubygems_version: 3.6.0.dev
92
+ rubygems_version: 3.5.6
93
93
  signing_key:
94
94
  specification_version: 4
95
95
  summary: traceroute-like program for measuring hops, path MTU, TTL and latency.