rpc: Use netmasks instead of wildcards for IP address matching … #4102

pull laanwj wants to merge 6 commits into bitcoin:master from laanwj:2014_04_cidr changing 9 files +301 −79
  1. laanwj commented at 12:00 PM on April 28, 2014: member

    As discussed on IRC.

    -rpcallowip currently has a wacky wildcard-based format. After this commit it will accept the more standard format, for example:

    • Ranges with netmask 127.0.0.0/255.255.255.0, ::/0
    • Ranges with cidr 12.3.4.5/24, 12:34:56:78:9a:bc:de:00/112
    • Loose IPs ::1, 127.0.0.1

    Trying to use the old *?-based format will result in an error message at launch. Most people will likely be specifying single IPs, so won't notice this change at all.

  2. jgarzik commented at 1:18 PM on April 28, 2014: contributor

    untested ACK

  3. sipa commented at 6:42 PM on April 29, 2014: member

    Code and idea ACK. I didn't test, but the unit tests are convincing.

  4. gmaxwell closed this on May 3, 2014

  5. gmaxwell reopened this on May 3, 2014

  6. laanwj commented at 6:04 AM on May 4, 2014: member

    @gmaxwell huh? You mean the scriptable, turing complete, non-linear IP mapping we discussed on IRC?

  7. laanwj added this to the milestone 0.10.0 on May 9, 2014
  8. util: add parseint32 function with strict error reporting
    None of the current integer parsing functions in util
    check whether the result is valid and fits in the range
    of the type. This is required for less sloppy error reporting.
    0d4ea1cf8a
  9. Use new function parseint32 in SplitHostPort
    Use the new function parseint32 in SplitHostPort instead of calling
    strtol directly.
    d864275299
  10. net: Add CSubNet class for subnet matching e16be73753
  11. rpc: Use netmasks instead of wildcards for IP address matching
    `-rpcallowip` currently has a wacky wildcard-based format. After this
    commit it will accept the more standard format, for example:
    
    - Ranges with netmask 127.0.0.0/255.255.255.0, ::/0
    - Ranges with cidr 12.3.4.5/24, 12:34:56:78:9a:bc:de:00/112
    - Loose IPs ::1, 127.0.0.1
    
    Trying to use the old *?-based format will result in an error message at
    launch.
    ee21912510
  12. Remove unused function WildcardMatch
    No longer necessary after implementing netmask-based matching.
    Also remove a longer-unused function `skipspaces`.
    fdbd7075ca
  13. Add tests for BoostAsioToCNetAddr 21bf3d257b
  14. laanwj merged this on May 9, 2014
  15. laanwj closed this on May 9, 2014

  16. laanwj referenced this in commit 605d5b5558 on May 9, 2014
  17. BitcoinPullTester commented at 4:19 PM on May 9, 2014: none

    Automatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/21bf3d257b88c45e2bb0b47e36e73d7462760c2c for binaries and test log. This test script verifies pulls every time they are updated. It, however, dies sometimes and fails to test properly. If you are waiting on a test, please check timestamps to verify that the test.log is moving at http://jenkins.bluematt.me/pull-tester/current/ Contact BlueMatt on freenode if something looks broken.

  18. DrahtBot locked this on Sep 8, 2021

Milestone
0.10.0


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-04-13 18:15 UTC

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