indutny / indutny/node-ip

Private IPv4 mapped regions are only matched in dot-notation

Open Beginner friendly
#122 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
1.5k
Forks
228
PR merge metrics
No merged PRs in 30d

Description

The `isPrivate` function only matches IPv4 mapped addresses in compacted dot-notation.

## Example
```js
var ip = require("ip")

console.log(ip.isPrivate("::ffff:127.0.0.1"))
console.log(ip.isPrivate("::ffff:7f00:0001"))
console.log(ip.isPrivate("0:0:0:0:0:ffff:127.0.0.1"))
console.log(ip.isPrivate("0:0:0:0:0:ffff:7f00:0001"))
```

### Expected
```js
true
true
true
true
```

### Actual
```js
true
false
false
false
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by locating the isPrivate function in the node-ip source and trace how IPv4-mapped IPv6 addresses are parsed and compared. Reproduce the four examples from the issue, then add coverage for the compacted and expanded forms and confirm all expected results pass in the existing test suite.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
networking
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.