Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Traceroute ignored IPs when multiple IPs on hop #560

Open
poclecoqq opened this issue Apr 16, 2024 · 2 comments
Open

Bug: Traceroute ignored IPs when multiple IPs on hop #560

poclecoqq opened this issue Apr 16, 2024 · 2 comments
Labels
bug Something isn't working ready-to-ship

Comments

@poclecoqq
Copy link

Description: When a hop in a traceroute has many IPs, the parser only considers the first IP it sees and ignores the others.

Given a traceroute with a line such as:

12  http://as15169-10g-sk1.sthix.net  (192.121.80.47) [*]  10.010 ms 72.14.196.42 (72.14.196.42) [AS15169]  9.182 ms  44.983 ms

we would expect jc to return (for that hop/line):

{
            "hop": 12,
            "probes": [
                {
                    "annotation": null,
                    "asn": null,
                    "ip": "192.121.80.47",
                    "name": "http://as15169-10g-sk1.sthix.net",
                    "rtt": 10.01
                },
                {
                    "annotation": null,
                    "asn": 15169,
                    "ip": "72.14.196.42",
                    "name": "72.14.196.42",
                    "rtt": 9.182
                },
                {
                    "annotation": null,
                    "asn": 15169,
                    "ip": "72.14.196.42",
                    "name": "72.14.196.42",
                    "rtt": 44.983
                }
            ]
},

instead, it currently returns (please compare the IP, name, and ASN fields):

        {
            "hop": 12,
            "probes": [
                {
                    "annotation": null,
                    "asn": 15169,
                    "ip": "192.121.80.47",
                    "name": "http://as15169-10g-sk1.sthix.net",
                    "rtt": 10.01
                },
                {
                    "annotation": null,
                    "asn": 15169,
                    "ip": "192.121.80.47",
                    "name": "http://as15169-10g-sk1.sthix.net",
                    "rtt": 9.182
                },
                {
                    "annotation": null,
                    "asn": 15169,
                    "ip": "192.121.80.47",
                    "name": "http://as15169-10g-sk1.sthix.net",
                    "rtt": 44.983
                }
            ]
        },

The example above is an extract from ./tests/fixtures/generic/traceroute1.out. I have already fixed that bug in a forked repository.

@kellyjonbrazil kellyjonbrazil added the bug Something isn't working label Apr 18, 2024
@kellyjonbrazil
Copy link
Owner

Thanks for reporting this. I created a PR from your fork and will take a look at merging that in.

@kellyjonbrazil
Copy link
Owner

kellyjonbrazil commented Apr 29, 2024

This is fixed in the dev branch and will make it into the next release.

https://github.com/kellyjonbrazil/jc/blob/dev/jc/parsers/traceroute.py

You can test by copying the parser file above into your parser plugin folder:

  • Linux/unix: $HOME/.local/share/jc/jcparsers
  • macOS: $HOME/Library/Application Support/jc/jcparsers
  • Windows: $LOCALAPPDATA\jc\jc\jcparsers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ready-to-ship
Projects
None yet
Development

No branches or pull requests

2 participants