![]() ![]() Clearly, this is a totally and completely unconscionable waste of space. However, not only is the address block 127.0.0.1/32 provided, and even 127.0.0.0/24 is provided as well but in fact the whole range 127.0.0.0/8 is provided. use std::net:: ", v4_in_v6, v4_in_v6.to_ipv4().unwrap(). Why is there more than one loopback IP address Most applications only need the one loopback IP address of 127.0.0.1. This is ordinarily implemented using only 127.0.0.1/32 for loopback. A datagram sent by a higher-level protocol to an address anywhere within this block loops back inside the host. I also guess that having the current minimal checks in both variants (v4 and v6) makes sense but the general is_loopback in IpAddr itself could provide the convenient conversion as it covers v4 and v6 anyways. RFC 5735 Special Use IPv4 Addresses January 2010 127.0.0.0/8 - This block is assigned for use as the Internet host loopback address. The current documentation in Ipv6Addr states that it is a check for but a clear statement that IPv4 in IPv6 loopback addresses are not covered might help. ![]() ![]() Usage of loopback addresses are particularly popular with developers and anyone in IT performing network tests. A loopback is an address that causes the traffic to be sent to the same interface is was sent out on on the localhost. In my opinion, this behavior should either be clearly documented in the standard library or better yet should happen automatically (at least in IpAddr) since an ipv6 encapsulated ipv4 loopback address is still a perfectly valid loopback address. If you are working on a network you are going to see some IPv6 traffic and it can get quite confusing. I then have to manually try conversion of the Ipv6Addr into an Ipv4Addr and perform a second check with is_loopback. ACX Series,ACX5048,ACX5096,T Series,M Series,MX Series. Once I bind my server to to work on IPv4 AND IPv6 at the same time and then query it via v4 to 127.0.0.1 the is_loopback call returns false. If I bind my server so 0.0.0.0 or and telnet/curl from localhost, I can easily tell whether the connection came from a local user or not by using the is_loopback call on IpAddr, Ipv4Addr or Ipv6Addr. While writing some networking code and making it IPv6 ready I encountered some odd behavior in the standard library. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |