[tor-bugs] #32994 [Core Tor/Tor]: Get all flag defaults from port_cfg_new()

Tor Bug Tracker & Wiki blackhole at torproject.org
Wed Mar 11 11:37:44 UTC 2020


#32994: Get all flag defaults from port_cfg_new()
-------------------------------------------------+-------------------------
 Reporter:  teor                                 |          Owner:
                                                 |  MrSquanchee
     Type:  defect                               |         Status:
                                                 |  assigned
 Priority:  Medium                               |      Milestone:  Tor:
                                                 |  unspecified
Component:  Core Tor/Tor                         |        Version:
 Severity:  Normal                               |     Resolution:
 Keywords:  technical-debt, tor-client, easy,    |  Actual Points:
  intro, outreachy-ipv6                          |
Parent ID:                                       |         Points:  1
 Reviewer:                                       |        Sponsor:
-------------------------------------------------+-------------------------

Comment (by MrSquanchee):

 Hii I have added all the default flags in `port_cfg_new()`. But I can't
 see as to why I need to update `port_parse_config()` and
 `connection_listener_new()` as they seem to work very well and are
 encapsulated from `port_cfg_new()` (Please correct me if I go wrong). The
 default flags and their values are as follows -->
 {{{
 /* entry_cfg flags */
   cfg->entry_cfg.ipv4_traffic = 1;
   cfg->entry_cfg.ipv6_traffic = 1;
   cfg->entry_cfg.prefer_ipv6 = 1;
   cfg->entry_cfg.dns_request = 1;
   cfg->entry_cfg.onion_traffic = 1;
   cfg->entry_cfg.prefer_ipv6_virtaddr = 1;
   cfg->entry_cfg.socks_prefer_no_auth = 0;
   cfg->entry_cfg.socks_iso_keep_alive = 0;
   cfg->entry_cfg.cache_ipv4_answers = 0;
   cfg->entry_cfg.cache_ipv6_answers = 0;
   cfg->entry_cfg.use_cached_ipv4_answers = 0;
   cfg->entry_cfg.use_cached_ipv6_answers = 0;
   cfg->entry_cfg.extended_socks5_codes = 0;

   /* server_cfg flags */
   cfg->server_cfg.no_advertise = 0;
   cfg->server_cfg.no_listen = 0;
   cfg->server_cfg.all_addrs = 0;
   cfg->server_cfg.bind_ipv4_only = 0;
   cfg->server_cfg.bind_ipv6_only = 0;

   /* other flags */
   cfg->is_group_writable = 0;
   cfg->is_world_writable = 0;
   cfg->relax_dirmode_check = 0;`
 }}}

 These flags are reflected by the initial flag values set in
 `port_parse_config()` here
 [https://gitweb.torproject.org/tor.git/tree/src/app/config/config.c#n6137]

 If you guys agree, I will open a PR in Github.com.
 Waiting for your suggestions.

 Thank you,

 Suraj (MrSquanchee)

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/32994#comment:7>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list