ruby / ruby/ipaddr

== fails

Open
#21 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Ruby
Stars
82
Forks
42
Avg merge
2h 24m
Merged PRs (30d)
3

Description

Not sure if it is intended behaviour, but IPAddr.new('10.0.0.0/16') == IPAddr.new('10.0.0.0/8') is true, when these are not the same network. The test should be

def ==(value)
@addr == value.addr && @mask_addr == value.mask_addr
end
Which also means adding
attr_reader :addr
attr_reader :mask_addr

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 IPAddr#== implementation used by IPAddr.new; the issue identifies the address and mask values that equality should consider. Confirm the behavior with a focused regression test showing that different masks are not equal, and ensure the existing equality cases still pass.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.