indutny / indutny/node-ip

cidrSubnet('108.162.192.0/18').contains('::ffff:108.162.245.126') returns false

Open
#104 1 comment 8 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
1.5k
Forks
228
PR merge metrics
No merged PRs in 30d

Description

Not sure if this is normal but it caused me to waste some time:

using ^1.1.5:
```
const ip = require('ip')
console.log(ip.cidrSubnet('108.162.192.0/18').contains('::ffff:108.162.245.126')) // false
console.log(ip.cidrSubnet('108.162.192.0/18').contains('108.162.245.126')) // true
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the two cidrSubnet(...).contains(...) calls from the issue, then locate the cidrSubnet and contains implementation in the package. Check how IPv4-mapped IPv6 input is handled and determine the intended result; done should include behavior consistent with that decision and regression coverage for the shown case.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
backend, networking
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.