ip2location / ip2location-traceroute

A traceroute tools that displaying geolocation information using IP2Location database.
MIT License
22 stars 3 forks source link

Works flaky under Windows #1

Open gvanem opened 3 years ago

gvanem commented 3 years ago

Th README.md doesn't mention if Windows is supported. Since the use or the POSIX headers in the code, one would assume it won't work under Windows at all.

But creating a small Makefile for Cygwin32, it kinda works. Except I get only a result for the final IP (the -p address):

ip2trace.exe -d %APPDATA%/IP2LOCATION-LITE-DB11.IPV6.BIN -p www.cnn.com
IP2Location Geolocation Traceroute (ip2trace) Version 8.0.0
Copyright (c) 2021 IP2Location.com [MIT License]
https://www.ip2location.com/free/traceroute-application

1.  *
2.  *
3.  *
4.  *
5.  *
6.  *
7.  *
8.  151.101.1.67 0.0000 ms ["US","United States of America","California","San Francisco","37.775700","-122.395203","94107","-08:00"]

I don't think that's the intention. For reference, my own version of a Watt-32 tracert (using IP2Location), shows:

Resolving www.cnn.com...CNAME turner-tls.map.fastly.net 151.101.237.67
ICMP traceroute to www.cnn.com (151.101.237.67), 30 hops max, 42 byte packets
 1  router                         (10.0.0.1)          34 ms  14 ms  priv
 2  ti0040q160-gw.ti.telenor.net   (88.95.101.1)       29 ms  30 ms, Norway / Oslo
 3  ti0040a400.ti.telenor.net      (146.172.70.112)    28 ms  30 ms, Norway / Nesoddtangen
 4  ti0020c360-ae14-0.ti.telenor.net (146.172.18.49)   45 ms  46 ms, Norway / Nesoddtangen
 5  ti0016c360-ae18-0.ti.telenor.net (146.172.23.133)  44 ms  46 ms, Norway / Nesoddtangen
 6  ti0001b400-ae0-0.ti.telenor.net (146.172.105.49)   45 ms  46 ms, Norway / Nesoddtangen
 7  * *
 8  151.101.237.67                 (151.101.237.67)    29 ms  44 ms, United States / San Francisco

Seems to be an issue with either setsockopt(sockfd, IPPROTO_IP,..) or (mis-)handling of SOCK_RAW sockets under Windows.

ip2location commented 3 years ago

Can you make a pull request for these changes? Thanks for your efforts!

gvanem commented 3 years ago

How can I do that when I don't know what the problem is?

ip2location commented 3 years ago

It's not tested and optimized under a Windows environment at this moment.

112NAIF commented 1 year ago

كيف ذالك