Opened 5 years ago

Closed 5 years ago

#12700 closed defect (fixed)

relay_command_to_string() doesn't know about EXTEND2 / EXTENDED2

Reported by: arma Owned by:
Priority: Medium Milestone: Tor: 0.2.5.x-final
Component: Core Tor/Tor Version:
Severity: Keywords: tor-relay 026-triaged-1 easy 025-backport 024-backport
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description (last modified by arma)

Apparently we left EXTEND2 and EXTENDED2 out of this function's big switch statement when we introduced these relay commands.

We could add the two lines in -- that would be easy, and somebody should.

The slightly more complicated question: is there a way to rephrase this function to future-proof it better against the next time we add a new relay command?

Child Tickets

Change History (8)

comment:1 Changed 5 years ago by arma

Description: modified (diff)

comment:2 Changed 5 years ago by nickm

Right now it does default: "return (unrecognized)";. To make it a little more future-proof, you could add a static char buffer and sprintf into it on default?

comment:3 Changed 5 years ago by nickm

Keywords: tor-relay 026-triaged-1 easy 025-backport 024-backport added

comment:4 Changed 5 years ago by nickm

To be clear, the static char buffer would be for the default: case only, like we do in conn_type_to_string() and some other functions. (Somebody asked about this on IRC.)

comment:5 Changed 5 years ago by nickm

Status: newneeds_review

Trivial fix in branch "bug12700_024".

comment:6 Changed 5 years ago by Sebastian

lgtm

comment:7 Changed 5 years ago by nickm

Milestone: Tor: 0.2.6.x-finalTor: 0.2.5.x-final

merged to master; marking for possible backport.

comment:8 Changed 5 years ago by nickm

Resolution: fixed
Status: needs_reviewclosed

Merged to 0.2.5.

Note: See TracTickets for help on using tickets.