https://bugs.ruby-lang.org/https://bugs.ruby-lang.org/favicon.ico?17113305112017-11-20T05:40:26ZRuby Issue Tracking SystemRuby master - Bug #14119: IPAddr#include? does not seem to support the subnet maskhttps://bugs.ruby-lang.org/issues/14119?journal_id=678652017-11-20T05:40:26Zk1LoW (Ken'ichiro Oyama)
<ul><li><strong>Subject</strong> changed from <i>IPAdrr#include? does not seem to support the subnet mask</i> to <i>IPAddr#include? does not seem to support the subnet mask</i></li></ul><p>s/IPAdrr/IPAddr/ です。申し訳ありません。。。</p> Ruby master - Bug #14119: IPAddr#include? does not seem to support the subnet maskhttps://bugs.ruby-lang.org/issues/14119?journal_id=678662017-11-20T05:42:48Zhsbt (Hiroshi SHIBATA)hsbt@ruby-lang.org
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Assigned</i></li><li><strong>Assignee</strong> set to <i>knu (Akinori MUSHA)</i></li></ul> Ruby master - Bug #14119: IPAddr#include? does not seem to support the subnet maskhttps://bugs.ruby-lang.org/issues/14119?journal_id=824012019-10-31T17:12:15Zjeremyevans0 (Jeremy Evans)merch-redmine@jeremyevans.net
<ul><li><strong>File</strong> <a href="/attachments/8118">ipaddr-include-cover-14119.patch</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/8118/ipaddr-include-cover-14119.patch">ipaddr-include-cover-14119.patch</a> added</li></ul><p>I'm not sure this is a bug, but it certainly seems like a bug to me. <code>IPAddr#include?</code> must consider the netmask of the receiver in order to work, for it not to consider the netmask of the argument seems wrong.</p>
<p>Attached is a patch that uses <code>Range#cover?</code> to implement the include check, which I think is the best way of solving the issue. It does not break any existing tests. It also is a much simpler implementation.</p> Ruby master - Bug #14119: IPAddr#include? does not seem to support the subnet maskhttps://bugs.ruby-lang.org/issues/14119?journal_id=829472019-12-03T22:38:34Zjeremyevans0 (Jeremy Evans)merch-redmine@jeremyevans.net
<ul></ul><p>As ipaddr has been moved to a gem, I have submitted a pull request for this: <a href="https://github.com/ruby/ipaddr/pull/22" class="external">https://github.com/ruby/ipaddr/pull/22</a></p> Ruby master - Bug #14119: IPAddr#include? does not seem to support the subnet maskhttps://bugs.ruby-lang.org/issues/14119?journal_id=845162020-03-06T21:39:58Zjeremyevans0 (Jeremy Evans)merch-redmine@jeremyevans.net
<ul><li><strong>Status</strong> changed from <i>Assigned</i> to <i>Closed</i></li></ul>