HomePhabricator

Fix two problems in CSubNet parsing
b45c50ce511dUnpublished

Unpublished Commit ยท Learn More

Repository Importing: This repository is still importing.

Description

Fix two problems in CSubNet parsing

Fix two CSubNet constructor problems:

  • The use of /x where 8 does not divide x was broken, due to a bit-order issue
  • The use of e.g. 1.2.3.4/24 where the netmasked bits in the network are not 0 was broken. Fix this by explicitly normalizing the netwok according to the bitmask.

Also add tests for these cases.

Fixes #6179. Thanks to @jonasschnelli for reporting and initial fix.

Details

Provenance
Wladimir J. van der Laan <laanwj@gmail.com>Authored on May 26 2015, 06:59
schancelPushed on Jan 5 2018, 21:58
schancelPushed on Jan 5 2018, 21:39
schancelPushed on Jan 5 2018, 21:17
Parents
rSTAGING19e8d7be4203: Simplify code for CSubnet
Branches
Unknown
Tags
Unknown

Event Timeline

Wladimir J. van der Laan <laanwj@gmail.com> committed rSTAGINGb45c50ce511d: Fix two problems in CSubNet parsing (authored by Wladimir J. van der Laan <laanwj@gmail.com>).May 26 2015, 06:59