< :前の番号
^ :番号順リスト
> :次の番号
P :前の記事(スレッド移動)
N :次の記事(スレッド移動)
|<:前のスレッド
>|:次のスレッド
^ :返事先
_:自分への返事
>:同じ返事先を持つ記事(前)
<:同じ返事先を持つ記事(後)
---:分割してスレッド表示、再表示
| :分割して(縦)スレッド表示、再表示
~ :スレッドのフレーム消去
.:インデックス
..:インデックスのインデックス
Bug #1275: IPAddr unnecessarily destroys information on creation
http://redmine.ruby-lang.org/issues/show/1275
Author: Christopher Smith
Status: Open, Priority: Normal
Category: core
ruby -v: 1.9.1
The IPAddr class internally stores both a complete IP address and a network mask. For many applications, client code needs to be able to track an interface's IP address (say, 10.253.0.20) and its netmask (/24), and in IPv6, both the 128-bit identifier and the netmask are generally considered part of the address.
The current implementation of IPAddr immediately clears all masked bits, making it impossible to store information like "10.253.0.20/24"; instead, the class stores only the *network* address of 10.253.0.0/24.
Since it is always possible to mask off bits later, IPAddr should internally store the entire address alongside the netmask and provide the masked address on request (as already provided in #mask). I suggest adding an option "mask_host_part=true" to initialize and changing the check condition at 483 to "if prefixlen and mask_host_part" (to keep from breaking current code).
----------------------------------------
http://redmine.ruby-lang.org