Project

General

Profile

Actions

Backport #3144

closed

resolv-replace Changes IPAddr.new() Behavior, Degrades IP Validation Rules

Added by dotdotdotPaul (Paul Clegg) almost 14 years ago. Updated almost 13 years ago.


Description

=begin
By default, calling IPAddr.new("1.2.3.256") results in an ArgumentError exception being raised.

If resolv-replace is require'd, however, the behavior changes; no exception is raised, and an IPAddr object with an IPv4 address of "1.2.3.0" is returned.

This appears to be due to the call to IPSocket.getaddress() being changed to use the Resolv object's getaddress call instead, and it is not raising exceptions on invalid IP addresses the same way.

It seems like the require'ing of resolv-replace should not change the behavior of IPAddr.new(); whether this means the Resolv lib needs to change to be more less forgiving of bogus IP addresses, or the IPAddr lib needs to be less dependent on IPSocket.getaddress(), I'm not sure.
=end

Actions #1

Updated by mame (Yusuke Endoh) almost 14 years ago

  • Status changed from Open to Closed

=begin
Fixed at r27389. Thanks!

--
Yusuke Endoh
=end

Actions #2

Updated by shyouhei (Shyouhei Urabe) over 13 years ago

  • Status changed from Closed to Assigned
  • Assignee set to shyouhei (Shyouhei Urabe)

=begin

=end

Actions #3

Updated by shyouhei (Shyouhei Urabe) over 13 years ago

  • Status changed from Assigned to Closed
  • % Done changed from 0 to 100

=begin
This issue was solved with changeset r30303.
Paul, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.

=end

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0