CSubNet::Match(): calculation error #6179

issue jonasschnelli opened this issue on May 23, 2015
  1. jonasschnelli commented at 12:34 PM on May 23, 2015: contributor

    CSubNet::Match() (check if a IP is within a subnet) is wrong. Currently this only affects the -whitelist config/startup argument. Examples: if you specify -whitelist=192.168.0.1/24, 192.168.0.2 does not match (but it should). This also happens for more complex subnet definitions like 192.168.0.20/29 where 192.168.0.18 should be within the subnet range, but CSubNet::Match() does return false.

    Edit: also affects -rpcallowip

  2. jonasschnelli commented at 7:53 AM on May 24, 2015: contributor

    The ip/CIDR string to CSubNet constructor is also buggy. Working on a fix.

  3. laanwj added the label Bug on May 26, 2015
  4. laanwj referenced this in commit b45c50ce51 on May 26, 2015
  5. laanwj closed this on May 27, 2015

  6. laanwj referenced this in commit ae3d8f371a on May 27, 2015
  7. reddink referenced this in commit 202debc4d4 on May 27, 2020
  8. DrahtBot locked this on Sep 8, 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-04-13 21:15 UTC

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