Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ticket33222 #1874

Merged
merged 47 commits into from Jun 9, 2020
Merged

Ticket33222 #1874

Changes from 1 commit
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
caab67d
nodelist: Distinguish client and relay reachability
teor2345 Apr 30, 2020
c32a824
nodelist: Wrap long lines, and improve comments
teor2345 Apr 30, 2020
a202f03
practracker: Accept some wrapped long lines
teor2345 Apr 30, 2020
c5ee3d7
relay: Clarify reachability status check functions
teor2345 Apr 30, 2020
d1c52e5
relay: Wrap long lines
teor2345 Apr 30, 2020
42e765e
relay: Minor selftest comment updates
teor2345 Apr 30, 2020
18174fb
relay: Add an address family to self-test launches
teor2345 Apr 30, 2020
900994e
relay: Remove unused DirPort self-test code
teor2345 Apr 30, 2020
a250dd6
relay: Refactor reachability circuit launches
teor2345 Apr 30, 2020
01d940e
relay: Refactor dirport self-test circuit launch
teor2345 Apr 30, 2020
2a0e483
relay: Launch IPv4 and IPv6 ORPort self-test circuits
teor2345 Apr 30, 2020
aade9f3
relay: Log IPv4 and IPv6 ORPorts when testing reachability
teor2345 Apr 30, 2020
4969dee
relay: Update some self-test comments for IPv6
teor2345 Apr 30, 2020
4a36dfe
circuitbuild: Allow relays to send IPv6 extend cells
teor2345 Apr 30, 2020
05c56ae
Replace several C identifiers.
teor2345 May 7, 2020
74902c8
Wrap long lines
teor2345 May 7, 2020
e1eecac
Replace several C identifiers.
teor2345 May 7, 2020
2409968
Appease practracker: wrapping costs lines
teor2345 May 7, 2020
c76f310
routerinfo: Make router_get_orport() return an error status
teor2345 May 7, 2020
0daa1da
Define and use TOR_ADDRPORT_BUF_LEN
neelchauhan Apr 26, 2020
e887887
relay: Clarify a comment in selftest.c
teor2345 May 7, 2020
504b16f
relay: Rewrite inform_testing_reachability()
teor2345 May 7, 2020
492c512
relay: Improve docs on inform_testing_reachability()
teor2345 May 7, 2020
e787e52
protover: Declare support for Relay=3
teor2345 May 11, 2020
51f3214
protover: Sort version flags by their underlying protocols
teor2345 May 11, 2020
c7f085d
protover: Add node functions for IPv6 extend support
teor2345 May 11, 2020
b64972e
practracker: Accept extra or.h lines
teor2345 May 11, 2020
9e7f51e
circuit: Add flags for IPv6 extends
teor2345 May 11, 2020
1c1faf5
routerlist: Choose nodes that can initiate IPv6 extends
teor2345 May 11, 2020
8829d2d
nodelist: Fix a comment and a log message
teor2345 May 11, 2020
e2bd15b
doc: Some tor features may not work with MiddleNodes
teor2345 May 11, 2020
4d2822e
changes: file for 33222 and 33226
teor2345 May 13, 2020
115a453
test/circuitbuild: Add a test for origin_circuit_init()
teor2345 May 13, 2020
de979dd
practracker: Allow a few extra lines in circuituse
teor2345 May 13, 2020
e9c9e17
test/circuitstats: Fix a bunch of coding style issues
teor2345 May 14, 2020
9949b54
test/circuitstats: Refactor common code
teor2345 May 14, 2020
d41d13e
test: Move the origin circuit function to test helpers
teor2345 May 14, 2020
6a0fdf3
circuitbuild: test relays sending IPv6 extend cells
teor2345 May 14, 2020
2e41d82
circuitbuild: Refactor build state node selection flags
teor2345 May 14, 2020
5f577b0
circuitbuild: Refactor IPv6 extend node selection
teor2345 May 14, 2020
c39394a
test/circuitbuild: Tests for node selection flags
teor2345 May 15, 2020
a702e92
protover: Add defines for recent protocol versions
teor2345 May 15, 2020
277baf6
versions: Improve the protover summary comments
teor2345 May 15, 2020
c6bcc92
test/protover: Add tests for summarize flags
teor2345 May 15, 2020
f05c144
rust: declare HSIntro=5
teor2345 May 18, 2020
3efe535
rust/protover: Fix protocol version support error handling
teor2345 May 18, 2020
4bcec38
test/protover: Add debug logs to some tests
teor2345 May 18, 2020
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
rust/protover: Fix protocol version support error handling
Make Rust protocol version support checks consistent with the
undocumented error behaviour of the corresponding C code.

Fixes bug 34251; bugfix on 0.3.3.5-rc.
  • Loading branch information
teor2345 committed May 18, 2020
commit 3efe53562fea2f4d71f0f620e10f4b5319b99fcb
@@ -0,0 +1,4 @@
o Minor bugfixes (rust, protocol versions):
- Make Rust protocol version support checks consistent with the
undocumented error behaviour of the corresponding C code.
Fixes bug 34251; bugfix on 0.3.3.5-rc.
@@ -326,6 +326,9 @@ protover_is_supported_here(protocol_type_t pr, uint32_t ver)
/**
* Return true iff "list" encodes a protocol list that includes support for
* the indicated protocol and version.
*
* If the protocol list is unparseable, treat it as if it defines no
* protocols, and return 0.
*/
int
protocol_list_supports_protocol(const char *list, protocol_type_t tp,
@@ -348,6 +351,9 @@ protocol_list_supports_protocol(const char *list, protocol_type_t tp,
/**
* Return true iff "list" encodes a protocol list that includes support for
* the indicated protocol and version, or some later version.
*
* If the protocol list is unparseable, treat it as if it defines no
* protocols, and return 0.
*/
int
protocol_list_supports_protocol_or_later(const char *list,
@@ -740,6 +746,9 @@ protover_compute_vote(const smartlist_t *list_of_proto_strings,
* one that we support, and false otherwise. If <b>missing_out</b> is
* provided, set it to the list of protocols we do not support.
*
* If the protocol version string is unparseable, treat it as if it defines no
* protocols, and return 1.
*
* NOTE: This is quadratic, but we don't do it much: only a few times per
* consensus. Checking signatures should be way more expensive than this
* ever would be.
@@ -84,7 +84,7 @@ pub extern "C" fn protocol_list_supports_protocol(
version: uint32_t,
) -> c_int {
if c_protocol_list.is_null() {
return 1;
return 0;
}

// Require an unsafe block to read the version from a C string. The pointer
@@ -93,7 +93,7 @@ pub extern "C" fn protocol_list_supports_protocol(

let protocol_list = match c_str.to_str() {
Ok(n) => n,
Err(_) => return 1,
Err(_) => return 0,
};
let proto_entry: UnvalidatedProtoEntry = match protocol_list.parse() {
Ok(n) => n,
@@ -140,7 +140,7 @@ pub extern "C" fn protocol_list_supports_protocol_or_later(
version: uint32_t,
) -> c_int {
if c_protocol_list.is_null() {
return 1;
return 0;
}

// Require an unsafe block to read the version from a C string. The pointer
@@ -149,7 +149,7 @@ pub extern "C" fn protocol_list_supports_protocol_or_later(

let protocol_list = match c_str.to_str() {
Ok(n) => n,
Err(_) => return 1,
Err(_) => return 0,
};

let protocol = match translate_to_rust(c_protocol) {
@@ -159,7 +159,7 @@ pub extern "C" fn protocol_list_supports_protocol_or_later(

let proto_entry: UnvalidatedProtoEntry = match protocol_list.parse() {
Ok(n) => n,
Err(_) => return 1,
Err(_) => return 0,
};

if proto_entry.supports_protocol_or_later(&protocol.into(), &version) {