indutny / indutny/node-ip

Comparing IPv4 with it's IPv6 equivalent

Open
#51 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
1.5k
Forks
228
PR merge metrics
No merged PRs in 30d

Description

I am trying to compare a req ip with a list of AWS ip ranges provided by Amazon here: http://docs.aws.amazon.com/general/latest/gr/aws-ip-ranges.html#aws-ip-download

The problem i'm having, is the req ip seems to be in the format `:::ffff:111.222.33.44` and the list of ranges is simple IPv4 format.

Using `if (ip.cidrSubnet(ip_prefix).contains(clients))` always returns false.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the cidrSubnet and contains calls described in the issue, then reproduce the comparison using the mapped IPv6 form :::ffff:111.222.33.44 and an AWS IPv4 range. Done means an equivalent IPv4 request address is compared correctly against the listed IPv4 ranges.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
networking
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.