portpolicy: note a spec issue

This commit is contained in:
Nick Mathewson 2020-10-19 08:08:38 -04:00
parent 9d6d26d310
commit 6f3d5d061d
2 changed files with 4 additions and 2 deletions

3
TODO
View File

@ -69,7 +69,8 @@ MILESTONE 3: Clean and tidy
- complete coverage on tor-proto arti#13 (2)
- Refactor XXXX and TODO code; make sure everything is tested and
documented. (1-4??)
- [arti#15 to make a list of these]
o [arti#15 to make a list of these] (1h)
- [arti#24 to resolve them]
- expand documentation in tor-proto, tor-netdir, tor-netdoc,
tor-cell. arti#16 (0.5)
- Is this "reactor" business a sensible design? Is there a better one?

View File

@ -75,8 +75,9 @@ impl PortPolicy {
/// gives an error if this range cannot appear next in sequence.
fn push_policy(&mut self, item: PortRange) -> Result<(), PolicyError> {
if let Some(prev) = self.allowed.last() {
// TODO SPEC: We don't enforce this in Tor, but we probably
// should.
if prev.hi >= item.lo {
// Or should this be ">"? TODO XXXXM3
return Err(PolicyError::InvalidPolicy);
} else if prev.hi == item.lo - 1 {
// We compress a-b,(b+1)-c into a-c.