Skip to content
Snippets Groups Projects
Commit f7a34305 authored by Damian Johnson's avatar Damian Johnson
Browse files

Use 'GETINFO exit-policy/full' to get exit policies

Our get_exit_policy() method predates tor's controller command to get it (we
were in 2013, whereas tor added the 'exit-policy/full' GETINFO option in 2014).
It has now been long enough that we can expect relays to have this.

This is much simpler and more reliable than attempting to make sense of the
user's ExitPolicy torrc entries...

  https://trac.torproject.org/projects/tor/ticket/25739

I'm a tad uncertain if tor's parsing is correct, but GETINFO should be the
authoritative source for how tor interprets it...

  >>> GETCONF ExitPolicy
  250 ExitPolicy=reject6 2a04:1447:4:3::74/32,accept 123.45.67.89:123,reject *:*

  >>> GETINFO exit-policy/full
  250+exit-policy/full=
  reject6 *:*
  accept 123.45.67.89:123
  reject *:*
  .
  250 OK
parent 2018f3fd
Branches
Tags
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment