[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [tor-bugs] #23873 [Core Tor/Tor]: Remove the return value of node_get_prim_orport()



#23873: Remove the return value of node_get_prim_orport()
----------------------------+------------------------------------
 Reporter:  teor            |          Owner:  (none)
     Type:  defect          |         Status:  new
 Priority:  Medium          |      Milestone:  Tor: 0.3.4.x-final
Component:  Core Tor/Tor    |        Version:
 Severity:  Normal          |     Resolution:
 Keywords:  technical-debt  |  Actual Points:
Parent ID:  #24403          |         Points:  1
 Reviewer:                  |        Sponsor:
----------------------------+------------------------------------

Comment (by teor):

 Replying to [comment:5 neel]:
 > In `node_get_prim_orport()`, if a ORPort exists, the return value comes
 from `RETURN_IPV4_AP()`. It seems `RETURN_IPV4_AP()` is a macro which
 returns 0 on succes. However, there is a `node_get_prim_dirport()` which
 also calls `RETURN_IPV4_AP()` for a return value. Should I also modify
 `node_get_prim_dirport()` (remove the return value and modify functions
 depending on it to check for a `NULL` address)?

 Yes, you should modify both the ORPort and DirPort functions.

 The functions that call them need to check the returned address using
 "tor_addr_port_is_valid()". Most callers will pass 0 for "for_listening",
 because they will be connecting to the address, rather than listening on
 it,

 Most of the callers already do a validity check, or they ignore invalid
 addresses later on.
 We should make sure each function handles invalid addresses correctly.

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/23873#comment:6>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
_______________________________________________
tor-bugs mailing list
tor-bugs@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs