]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Increase link_proto field to 2 bytes
authorNick Mathewson <nickm@torproject.org>
Mon, 11 Mar 2013 16:34:14 +0000 (12:34 -0400)
committerNick Mathewson <nickm@torproject.org>
Mon, 11 Mar 2013 16:34:14 +0000 (12:34 -0400)
This should have been 2 bytes all along, since version numbers can
be 16 bits long.  This isn't a live bug, since the call to
is_or_protocol_version_known in channel_tls_process_versions_cell
will reject any version number not in the range 1..4.  Still, let's
fix this before we accidentally start supporting version 256.

Reported pseudonymously. Fixes bug 8062; bugfix on 0.2.0.10-alpha --
specifically, on commit 6fcda529, where during development I
increased the width of a version to 16 bits without changing the
type of link_proto.

changes/bug8062 [new file with mode: 0644]
src/or/or.h

diff --git a/changes/bug8062 b/changes/bug8062
new file mode 100644 (file)
index 0000000..805e51e
--- /dev/null
@@ -0,0 +1,5 @@
+  o Minor bugfixes:
+    - Increase the width of the field used to remember a connection's
+      link protocol version to two bytes. Harmless for now, since the
+      only currently recognized versions are one byte long.  Reported
+      pseudynmously.  Fixes bug 8062, bugfix on 0.2.0.10-alpha.
index c7d259853b570ce2293a9bb00f82909c84235487..2fe36ba19190d6f98fc862823ae9be0b2ac01ee5 100644 (file)
@@ -1417,8 +1417,8 @@ typedef struct or_connection_t {
   unsigned int is_outgoing:1;
   unsigned int proxy_type:2; /**< One of PROXY_NONE...PROXY_SOCKS5 */
   unsigned int wide_circ_ids:1;
-  uint8_t link_proto; /**< What protocol version are we using? 0 for
-                       * "none negotiated yet." */
+  uint16_t link_proto; /**< What protocol version are we using? 0 for
+                        * "none negotiated yet." */
 
   or_handshake_state_t *handshake_state; /**< If we are setting this connection
                                           * up, state information to do so. */