Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

std::net: Ipv4Addr and Ipv6Addr improvements #60145

Merged
merged 20 commits into from
Jun 1, 2019
Merged

Commits on Apr 20, 2019

  1. Configuration menu
    Copy the full SHA
    02d815f View commit details
    Browse the repository at this point in the history
  2. std::net: improve Ipv6Addr::is_unicast_site_local() doc

    - quote the RFC
    - add a link to the RFC
    - fix markdown
    little-dude committed Apr 20, 2019
    Configuration menu
    Copy the full SHA
    5aea184 View commit details
    Browse the repository at this point in the history
  3. std::net: add Ipv6Addr::is_unicast_link_local_strict()

    RFC 4291 is a little unclear about what is a unicast link local address.
    According to section 2.4, the entire fe80::/10 range is reserved for
    these addresses, but section 2.5.3 defines a stricter format for such
    addresses.
    
    After a discussion[0] is has been decided to add a different method for
    each definition, so this commit:
    
      - renames is_unicast_link_local() into is_unicast_link_local_strict()
      - relaxed the check in is_unicast_link_local()
    
    [0]: rust-lang#27709 (comment)
    little-dude committed Apr 20, 2019
    Configuration menu
    Copy the full SHA
    1f0aa40 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    aea687c View commit details
    Browse the repository at this point in the history

Commits on Apr 22, 2019

  1. Configuration menu
    Copy the full SHA
    8f67997 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    de3cf0d View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    f87b967 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    67291cc View commit details
    Browse the repository at this point in the history
  5. std::net: fix Ipv4Addr::is_global()

    As per @therealbstern's comment[0]:
    
    The implementation of Ipv4::is_global is not complete, according to the
    IANA IPv4 Special-Purpose Address Registry.
    
            - It compares the address to 0.0.0.0, but anything in 0.0.0.0/8
              should not be considered global.
                    - 0/8 is not global and is currently forbidden because
                      some systems used to treat it as the local network.
                    - The implementation of Ipv4::is_unspecified is correct.
                      0.0.0.0 is the unspecified address.
            - It does not examine 100.64.0.0/10, which is "Shared Address
              Space" and not global.
            - Ditto 192.0.0.0/24 (IETF Protocol Assignments), except for
              192.0.0.9/32 and 192.0.0.10/32, which are carved out as
              globally reachable.
            - 198.18.0.0/15 is for "Benchmarking" and should not be globally
              reachable.
            - 240.0.0.0/4 is reserved and not currently reachable
    little-dude committed Apr 22, 2019
    Configuration menu
    Copy the full SHA
    9f6a747 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    8106320 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    c34bcc6 View commit details
    Browse the repository at this point in the history
  8. std::net: fix Ipv4addr::is_global() tests

    Ipv4addr::is_global() previously considered 0/8 was global, but has
    now been fixed, so these tests needed to be fixed as well.
    little-dude committed Apr 22, 2019
    Configuration menu
    Copy the full SHA
    c302d2c View commit details
    Browse the repository at this point in the history
  9. std::net: fix tests for site-local ipv6 addresses

    Ipv6Addr::is_unicast_global() now returns `true` for unicast site
    local addresses, since they are deprecated.
    little-dude committed Apr 22, 2019
    Configuration menu
    Copy the full SHA
    99d9bb6 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    40d0127 View commit details
    Browse the repository at this point in the history
  11. std::net: tests for Ipv4addr::is_benchmarking()

    also add test to Ipaddr, making sure that these addresses are not
    global.
    little-dude committed Apr 22, 2019
    Configuration menu
    Copy the full SHA
    9dcfd9f View commit details
    Browse the repository at this point in the history
  12. std::net: tests for Ipv4addr::is_ietf_protocol_assignment()

    Also add tests to IpAddr to make sure these addresses are not global.
    little-dude committed Apr 22, 2019
    Configuration menu
    Copy the full SHA
    a2bead8 View commit details
    Browse the repository at this point in the history
  13. std::net: tests for Ipv4addr::is_reserved()

    Also add tests to IpAddr for make sure these addresses are not global
    or multicast.
    little-dude committed Apr 22, 2019
    Configuration menu
    Copy the full SHA
    6662777 View commit details
    Browse the repository at this point in the history

Commits on Apr 23, 2019

  1. std::net: add warning in Ipv6Addr::is_unicast_site_local() doc

    site-local addresses are deprecated, so we should warn users about it.
    little-dude committed Apr 23, 2019
    Configuration menu
    Copy the full SHA
    634dcd0 View commit details
    Browse the repository at this point in the history
  2. std::net: add warning in Ipv4addr::is_reserved() documentation

    See @the8472 comment's on Github:
    rust-lang#60145 (comment)
    
    > I don't think is_reserved including ranges marked for future use is
    > a good idea since those future uses may be realized at at some point
    > and then old software with is_reserved filters may have false
    > positives. This is not a hypothetical concern, such issues have been
    > encountered before when IANA assigned previously reserved /8 address
    > blocks.
    little-dude committed Apr 23, 2019
    Configuration menu
    Copy the full SHA
    fe718ef View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    cddb838 View commit details
    Browse the repository at this point in the history