Git Product home page Git Product logo

Comments (3)

ScrumpyJack avatar ScrumpyJack commented on July 23, 2024

I think the problem is here

asn/asn

Lines 2300 to 2304 in d280c0a

if [ "$HAVE_IPV6" = true ]; then
ip_to_trace=$(echo "$ip" | grep -m1 ':')
else
ip_to_trace=$(echo "$ip" | grep -v -m1 ':')
fi

If ipify returns an IPv6 address for the host it's run from, then HAVE_IPV6 is set to true, but if a host passed to /asn_lookup& resolves to A records (and no AAAA records, thus populating $ip with a list of IPv4 addresses), then the grep on 2301 fails and $ip_to_trace doesn't get assigned anything.

Not sure why it works on the command line mode yet, it's possibly due to the fact that this bit gets skipped.

from asn.

nitefood avatar nitefood commented on July 23, 2024

Great catch! Again good analysis, this check gets indeed skipped when running from command line since its only purpose is to grab the first relevant IP when running web lookups, in order to speed up execution. The use case you describe (IPv6 on the server, IPv4-only target) is one that I missed while testing.

Can you please try changing line 2300 from:

			if [ "$HAVE_IPV6" = true ]; then

to:

			if [ "$HAVE_IPV6" = true ] && grep -q ':' <<<"$ip"; then

and confirm it fixes it?

Thanks again for your feedback!

from asn.

ScrumpyJack avatar ScrumpyJack commented on July 23, 2024

That'll do it. Thanks.

from asn.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.