Fix CNetAddr::IsRFC2544 comment + tests #17758

pull tynes wants to merge 2 commits into bitcoin:master from tynes:fix-isrfc2544 changing 2 files +3 −1
  1. tynes commented at 3:53 AM on December 17, 2019: contributor

    The comment describing the functionality of CNetAddr::IsRFC2544 is incorrect.

    https://github.com/bitcoin/bitcoin/blob/46d6930f8c7ba7cbcd7d86dd5d0117642fcbc819/src/netaddress.h#L57

    It should actually read 198.18.0.0/15 based on RFC 3330:

       198.18.0.0/15 - This block has been allocated for use in benchmark
       tests of network interconnect devices.  Its use is documented in
       [RFC2544].
    

    See RFC 2544 here.

    See the implementation here:

    https://github.com/bitcoin/bitcoin/blob/47d981e8273804a040d71665a4cb16038d6717e1/src/netaddress.cpp#L142-L145

    This PR also adds tests for the minimum and maximum values that are valid RFC 2544 addresses.

  2. CNetAddr: fix IsRFC2544 comment 419ef3b7cc
  3. test: add IsRFC2544 tests 529d332fbf
  4. tynes renamed this:
    Fix CNetAddr::IsRFC2544 + tests
    Fix CNetAddr::IsRFC2544 comment + tests
    on Dec 17, 2019
  5. fanquake added the label P2P on Dec 17, 2019
  6. practicalswift commented at 8:34 AM on December 17, 2019: contributor

    Good catch and nice first-time contribution! Hope to see more contributions from you in the future :)

    ACK 529d332fbfe633d60845a97e1a06f552bd63d0d4

    $ ipcalc 198.18.0.0/15
    Address:   198.18.0.0           11000110.0001001 0.00000000.00000000
    Netmask:   255.254.0.0 = 15     11111111.1111111 0.00000000.00000000
    Wildcard:  0.1.255.255          00000000.0000000 1.11111111.11111111
    =>
    Network:   198.18.0.0/15        11000110.0001001 0.00000000.00000000
    HostMin:   198.18.0.1           11000110.0001001 0.00000000.00000001
    HostMax:   198.19.255.254       11000110.0001001 1.11111111.11111110
    Broadcast: 198.19.255.255       11000110.0001001 1.11111111.11111111
    Hosts/Net: 131070                Class C
    
  7. promag commented at 8:47 AM on December 17, 2019: member

    ACK 529d332fbfe633d60845a97e1a06f552bd63d0d4, nit could squash.

  8. jonatack commented at 10:53 AM on December 17, 2019: member

    ACK 529d332fbfe633d60845a97e1a06f552bd63d0d4

  9. MarkLTZ referenced this in commit 3bde2e4b4e on Dec 17, 2019
  10. laanwj commented at 3:14 PM on December 17, 2019: member

    ACK 529d332fbfe633d60845a97e1a06f552bd63d0d4

  11. laanwj referenced this in commit 7df6a7ea98 on Dec 17, 2019
  12. laanwj merged this on Dec 17, 2019
  13. laanwj closed this on Dec 17, 2019

  14. tynes commented at 4:19 PM on December 17, 2019: contributor

    @practicalswift Thank you for the encouragement! :)

  15. jasonbcox referenced this in commit 7ed757ca6b on Nov 9, 2020
  16. PastaPastaPasta referenced this in commit 09e5e809fc on Jun 27, 2021
  17. PastaPastaPasta referenced this in commit ed2800b1c4 on Jun 28, 2021
  18. PastaPastaPasta referenced this in commit 6099568d7d on Jun 29, 2021
  19. PastaPastaPasta referenced this in commit b022b5dfd2 on Jul 1, 2021
  20. PastaPastaPasta referenced this in commit 29f461bbbb on Jul 1, 2021
  21. PastaPastaPasta referenced this in commit a4508bb71d on Jul 14, 2021
  22. PastaPastaPasta referenced this in commit 470ba90778 on Jul 14, 2021
  23. PastaPastaPasta referenced this in commit 56cd5d3c97 on Jul 15, 2021
  24. random-zebra referenced this in commit b4751e10ce on Aug 11, 2021
  25. MarcoFalke locked this on Dec 16, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-05-02 12:14 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me