pass: a zero in the first, last, and a middle position, and
fail: an octal value in the first, last, and a middle position.
Consensus Changes
It's also worth noting that this change modifies directory document parsing. So authorities will reject some descriptors and votes that were previously valid. That's ok, because authorities can safely reject more directory documents, without breaking the consensus. (And Tor doesn't produce directory documents with octal IPv4 addresses by default.)
Implementation
This code looks correct, but it took me about 5 minutes to check it. We try not to write manual string-parsing code, because it's error-prone, and hard to maintain.
Instead of splitting the string manually, you could do something like:
But I think the extra dependency is worth it, to make the code simpler.
Before you make this change, neel, I'd like to check what dgoulet thinks. I'd also like to check with nickm that there's no reason we're avoiding a smartlist dependency at this level.
Trac: Status: needs_review to needs_revision Cc: neel to neel, nickm
Now with the last changes, we do use the heap quite a bit with the smartlist_t so why would we prefer not using the heap in the first place? Does it still matter now?
Now with the last changes, we do use the heap quite a bit with the smartlist_t so why would we prefer not using the heap in the first place? Does it still matter now?
It doesn't matter except to the extent that it slows us down... we should keep an eye on profiles after we merge this.
Can we add a smartlist_core dependency to lib/net ?
Yes: to see why, run ./scripts/maint/practracker/includes.py --toposort for a topological sort of our current modules from lowest to highest level. It appears that net is already much higher than smartlist_core.
One thing I want to think about, though: do we care about the fingerprinting issue? That is, this patch will create a class of addresses that some clients will parse and some clients will reject. Is that a security issue to worry about, or are we cool here?
Now with the last changes, we do use the heap quite a bit with the smartlist_t so why would we prefer not using the heap in the first place? Does it still matter now?
It doesn't matter except to the extent that it slows us down... we should keep an eye on profiles after we merge this.
Can we add a smartlist_core dependency to lib/net ?
Yes: to see why, run ./scripts/maint/practracker/includes.py --toposort for a topological sort of our current modules from lowest to highest level. It appears that net is already much higher than smartlist_core.
One thing I want to think about, though: do we care about the fingerprinting issue? That is, this patch will create a class of addresses that some clients will parse and some clients will reject. Is that a security issue to worry about, or are we cool here?
Authorities canonicalise addresses before they create the microdesc consensus and microdescriptors, so the only affected clients are bridge clients. (Bridge clients download relay descriptors.)
And for clients that use full relay descriptors on the public network, authorities will stop voting for those relays pretty soon.