indutny / indutny/node-ip

IPv6 CIDR contains() returns true when it should return false

Open
#89 3 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

Here’s an example:

```javascript
ip.cidrSubnet('2001:db8:f53b::/48').contains('2001:db8:f53a::1');
// returns: true, should return false

ip.cidrSubnet('2001:db8:f53b::/128').contains('2001:db8:f53a::1');
// returns: true, should return false
```

This seems obvious so, probably I’m using the library incorrectly, but I can’t see how to fix it.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by tracing the cidrSubnet().contains() implementation for IPv6 input and compare its behavior with the two examples in the issue. Add regression coverage for both the /48 and /128 cases, and consider the issue done when each returns false for the address shown.

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
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.