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

#32888: Log address config info when tor starts up #1910

Merged
merged 3 commits into from Jun 4, 2020

Conversation

Labels
None yet
Projects
None yet
4 participants
@c-chroniko
Copy link
Contributor

@c-chroniko c-chroniko commented Jun 2, 2020

Add debug logging as per Trac #32888

Per ticket #32888 this should address logging "the Address torrc
option", "and whether it is an IP address, or a DNS name"; or the
detected "local hostname", "and whether it is an IP address, or a DNS
name". Some of these details already seem to be logged, so just add
what's missing.
@coveralls
Copy link

@coveralls coveralls commented Jun 2, 2020

Pull Request Test Coverage Report for Build 9043

  • 6 of 6 (100.0%) changed or added relevant lines in 2 files are covered.
  • 3 unchanged lines in 3 files lost coverage.
  • Overall coverage decreased (-0.002%) to 64.175%

Files with Coverage Reduction New Missed Lines %
src/feature/hs/hs_common.c 1 84.48%
src/feature/hs/hs_service.c 1 74.53%
src/feature/relay/circuitbuild_relay.c 1 87.41%
Totals Coverage Status
Change from base Build 9026: -0.002%
Covered Lines: 50935
Relevant Lines: 79369

💛 - Coveralls

Add logging for "the local network interface addresses" as requested by
ticket #32888.
@@ -1693,12 +1693,20 @@ get_interface_address6,(int severity, sa_family_t family, tor_addr_t *addr))
/* Find the first non-internal address, or the last internal address
* Ideally, we want the default route, see #12377 for details */
SMARTLIST_FOREACH_BEGIN(addrs, tor_addr_t *, a) {
char *addr_str;
Copy link
Contributor

@nmathewson nmathewson Jun 3, 2020

Style issue: if a variable is only set once, it's often best to put the declaration at the point where it is set, as in char *addr_str = tor_addr_to_str_dup(addr);

Same with is_internal, which could be a const bool

rv = 0;

addr_str = tor_addr_to_str_dup(addr);
Copy link
Contributor

@nmathewson nmathewson Jun 3, 2020

Rather than allocating and freeing manually, it could be better to use the fmt_addr(), which uses a static buffer.

Conform to C99 as suggested by nickm on #32888 and use fmt_addr() rather
than tor_addr_to_str_dup()
@torproject-pusher torproject-pusher merged commit 2b98df3 into torproject:master Jun 4, 2020
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment